Daily updates from Odoo
Navigate
Branch
Tuesday, August 22, 2023
28 changes
Security fixes and vulnerability patches
Studio approval rules for business actions are now validated by the server instead of relying mainly on browser-side checks. This prevents users from bypassing required approvals through direct calls or alternate buttons, while preserving automated elevated flows such as eCommerce order confirmation.
Original PR description
Before, the approval mechanism validation was mostly implemented in the frontend: * The frontend detects that a button has a approval validation with `get_spec_approval` * Whenever the button is…
Before, the approval mechanism validation was mostly implemented in the frontend: * The frontend detects that a button has a approval validation with `get_spec_approval` * Whenever the button is pressed, the frontend contacted the server to know if the user can indeed call the method (with `check_approval`) * If the server answered positively then the frontend did the call to the server to execute the method The problem is that a tech-savy user could bypass this approval check: * by manually calling the method on the model * by calling a button doing the same thing outside a form view Now, for method approval (in contrast to action approval) we do it in the backend: * The frontend detects that a button has a approval validation with `get_spec_approval` * The frontend does not need to know if it is approved or not, it directly call the method on the model * When receiving the call, the backend will now check if it is approved before executing it Technically, this PR is inspired by `base.automation`. When an approval rule is created/written then the corresponding method is patched to verify approval rules. task-id:3285734
Enhancements to existing features
Spreadsheet currency formatting now defaults to the main company currency instead of always using US dollars. This makes currency formatting faster and more accurate for companies operating in other currencies, such as euros.
The restaurant preparation display now shows the actual number of customers seated at a table instead of the table's maximum capacity. This helps kitchen and service teams better understand current party sizes and prepare orders with more accurate context.
Original PR description
In the preparation display, when using restaurant and table, the maximum number of guest on a table was shown. This PR is changing it to show the real number of clients at the table instead.
Resolved issues and error corrections
Approval users can now see approver entries assigned to them, even when the request was created by someone else. They also can no longer accidentally remove themselves as approvers, preventing lost access after a misclick.
Original PR description
Previously: 1. Simple user didn't see the approver lines that they were assigned to, unless it was their own request. 2. Simple user could remove themselves from the approvers list. The problem with this is that if it was misclick, they immediately loose access to the record and they can't undo it. In this commit: 1. we give read access to the simple user to the approver lines that they are assigned to (they are set as user_id). 2. We make user_id field readonly for simple user. task - 3339428
This fixes an error that could interrupt users when editing payslip lines in Payroll. Payroll staff can now change payslip line values and move away from the field without the screen failing.
Original PR description
Steps to reproduce: Go to payroll take a payslip click on - Edit Payslip Lines Modify for example the amount on one of the lines When you click away - you get : Uncaught Promise > Cannot read properties of undefined (reading 'res_id') Cause: Since relational model was refactored, '.__bm_load_params__' has been removed from the model and attempts of reading on it causes TypeError - Cannot read properties of undefined.
Users can once again export electronic invoice documents for Mexico in bulk from the invoice list. This fixes a download issue caused by those documents being stored differently, making compliance document retrieval easier for teams handling multiple invoices.
Original PR description
When selecting several invoices from the list view, it is possible to trigger an action to export all edi documents in a zip file. In 16.4, it was no longer possible to download edi documents for the Mexican localization because they are stored in a different field. With this commit, we extend the function that provide all edi documents to export to also include Mexican ones. task-130177
Code cleanup and technical improvements
Several test suites now use the standard notification service instead of a custom fake version. This keeps tests closer to real behavior while reducing maintenance effort, with no expected change for end users.
Original PR description
* = documents_spreadsheet, planning, timesheet_grid, web_studio The real service works just as well, gives more guarantee on what is actually tested, and requires less lines of code. https://github.com/odoo/odoo/pull/132744
This update adjusts internal tests so they stay aligned with recent mail system changes. It helps ensure helpdesk and mail-related workflows continue to behave reliably as future multi-company email alias support is prepared.
Original PR description
Simple adaptation to community changes. Task-3453347 (Mail: Move Mail ICP from Base to Mail) Prepares Task-36879 (Mail: Support MultiCompany Aliases)
The mobile web interface has been updated to stop using an older popover component. This helps keep the mobile experience easier to maintain and aligned with current platform standards, with no expected change for day-to-day users.
Original PR description
Replace usage of legacy Popover component. task-3439226
Miscellaneous changes
Some tests were failing because the `_computax_tax_totals` was not iterating on the records in self. Therefore a singleton error was raised Runbot error 24167 Forward-Port-Of: odoo/enterprise#46100
Original PR description
Some tests were failing because the `_computax_tax_totals` was not iterating on the records in self. Therefore a singleton error was raised Runbot error 24167 Forward-Port-Of: odoo/enterprise#46100
*: account, crm The thumbnails for the spreadsheet templates displayed the old app icons They've been replaced with new thumbnails with the new app icons. task-3470055 part of task-3326263 Forward-Port-Of: odoo/enterprise#45891
Original PR description
*: account, crm The thumbnails for the spreadsheet templates displayed the old app icons They've been replaced with new thumbnails with the new app icons. task-3470055 part of task-3326263 Forward-Port-Of: odoo/enterprise#45891
This PR changes unzipping process to upload images when cloning xlsx document. Uploading images in the model can avoid unnecessary transferring and is an important process when importing images in xlsx files. task [3125702](https://www.odoo.com/web#id=3125702&cids=1&menu_id=4720&action=333&active_id=2328&model=project.task&view_type=form) Forward-Port-Of: odoo/enterprise#43148
Original PR description
This PR changes unzipping process to upload images when cloning xlsx document. Uploading images in the model can avoid unnecessary transferring and is an important process when importing images in xlsx files. task [3125702](https://www.odoo.com/web#id=3125702&cids=1&menu_id=4720&action=333&active_id=2328&model=project.task&view_type=form) Forward-Port-Of: odoo/enterprise#43148
Improve the styling of analytic and analytic group by filters. Forward-Port-Of: odoo/enterprise#45868
Original PR description
Improve the styling of analytic and analytic group by filters. Forward-Port-Of: odoo/enterprise#45868
Add missing neutralisation for the l10n_br_avatax module introduced in https://github.com/odoo/enterprise/pull/43797 Waiting for the original PR to be fully forward-ported to cover all versions at once. https://github.com/odoo/enterprise/pull/44588 Forward-Port-Of: odoo/enterprise#45429 Forward-Port-Of: odoo/enterprise#44859
Original PR description
Add missing neutralisation for the l10n_br_avatax module introduced in https://github.com/odoo/enterprise/pull/43797 Waiting for the original PR to be fully forward-ported to cover all versions at once. https://github.com/odoo/enterprise/pull/44588 Forward-Port-Of: odoo/enterprise#45429 Forward-Port-Of: odoo/enterprise#44859
### Steps to reproduce - Enable batch payment in accounting settings. - Go to Accounting > Vendors > Payments > Select Multiple, but at least 2 records need to be different vendors, create a batch and Validate. - Go to Dashboard > Bank > New > Create a new transaction that matches one of the values in the batch payment, as well as making sure to set the Label field for this transaction to be exactly the Reference/Memo from the record you've chosen from the batch payment. - Go to Configuratio
Original PR description
### Steps to reproduce - Enable batch payment in accounting settings. - Go to Accounting > Vendors > Payments > Select Multiple, but at least 2 records need to be different vendors, create a batch…
### Steps to reproduce - Enable batch payment in accounting settings. - Go to Accounting > Vendors > Payments > Select Multiple, but at least 2 records need to be different vendors, create a batch and Validate. - Go to Dashboard > Bank > New > Create a new transaction that matches one of the values in the batch payment, as well as making sure to set the Label field for this transaction to be exactly the Reference/Memo from the record you've chosen from the batch payment. - Go to Configuration > Reconciliation Models > Invoices/Bills Perfect Match > Run Manually. - Return to Bank Journal from Accounting Dashboard > Discuss Log of the added transaction. ### Issue Note created which says ”This bank transaction has been automatically validated using the reconciliation model” but it's not the case. ### Reason of the problem We don't check if the statement line is reconciled before logging the success message. opw-3419358 Forward-Port-Of: odoo/enterprise#45805 Forward-Port-Of: odoo/enterprise#45431
This issue will be generated when retrieving real-time currency rate updates if the connection cannot be established or if the web services are unavailable at that time. Error message : Unable to connect to the online exchange rate platform bbr. The web service may be temporarily down. Traceback:- ``` ReadTimeout: HTTPSConnectionPool(host='olinda.bcb.gov.br', port=443): Read timed out. (read timeout=10) File "home/odoo/src/enterprise/saas-16.3/currency_rate_live/models/res_config_set
Original PR description
This issue will be generated when retrieving real-time currency rate updates if the connection cannot be established or if the web services are unavailable at that time. Error message : Unable to…
This issue will be generated when retrieving real-time currency rate updates if the connection cannot be established or if the web services are unavailable at that time.
Error message :
Unable to connect to the online exchange rate platform bbr. The web service may be temporarily down.
Traceback:-
```
ReadTimeout: HTTPSConnectionPool(host='olinda.bcb.gov.br', port=443): Read timed out. (read timeout=10)
File "home/odoo/src/enterprise/saas-16.3/currency_rate_live/models/res_config_settings.py", line 210, in update_currency_rates
parse_results = parse_function(active_currencies)
File "home/odoo/src/enterprise/saas-16.3/currency_rate_live/models/res_config_settings.py", line 417, in _parse_bbr_data
response = session.get(request_url, timeout=10)
File "requests/sessions.py", line 557, in get
return self.request('GET', url, **kwargs)
File "requests/sessions.py", line 544, in request
resp = self.send(prep, **send_kwargs)
File "requests/sessions.py", line 657, in send
r = adapter.send(request, **kwargs)
File "requests/adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
```
The logger is updated to use the 'warning' level instead of the 'exception' level. This change reflects a less severe logging level for cases when unable to connect online exchange rate
sentry-4330375314
Forward-Port-Of: odoo/enterprise#45328Before this, there was a computation of cash basis moves for each reconciliation done during FEC import and it can slow down a lot the import for nothing since no taxes will be in the imported entries so no cash basis will result from reconciliation. Now, the cash basis moves computation is skipped to improve the performance. Here are the stats of reconciliation time on fresh database using a FEC file of ~76000 amls including ~15000 reconciled. V15 without fix => 8 min 15 s V15 with fi
Original PR description
Before this, there was a computation of cash basis moves for each reconciliation done during FEC import and it can slow down a lot the import for nothing since no taxes will be in the imported entries so no cash basis will result from reconciliation. Now, the cash basis moves computation is skipped to improve the performance. Here are the stats of reconciliation time on fresh database using a FEC file of ~76000 amls including ~15000 reconciled. V15 without fix => 8 min 15 s V15 with fix => 5 min 27 s V16 without fix => 9 min 36 s V16 with fix => 1 min 33 s opw-3274391 Forward-Port-Of: odoo/enterprise#45812 Forward-Port-Of: odoo/enterprise#45603
The issue: you cannot select a journal group on any report, not matter how many times you click on the group, nothing happend, but selecting a journal works perfectly The fix: after filling the field action inside the variable __journal_group_action with the correct value, then we can change the value of selected for the journal variable. opw-3468070 Forward-Port-Of: odoo/enterprise#45874
Original PR description
The issue: you cannot select a journal group on any report, not matter how many times you click on the group, nothing happend, but selecting a journal works perfectly The fix: after filling the field action inside the variable __journal_group_action with the correct value, then we can change the value of selected for the journal variable. opw-3468070 Forward-Port-Of: odoo/enterprise#45874
Disable the inspector download button for the requested documents as those aren't linked to any files yet. Fix the traceback appearing when trying to upload a requested documents in the list view inspector with multiple documents selected. Task-3262084 Forward-Port-Of: odoo/enterprise#45947 Forward-Port-Of: odoo/enterprise#39873
Original PR description
Disable the inspector download button for the requested documents as those aren't linked to any files yet. Fix the traceback appearing when trying to upload a requested documents in the list view inspector with multiple documents selected. Task-3262084 Forward-Port-Of: odoo/enterprise#45947 Forward-Port-Of: odoo/enterprise#39873
[OPW-3230087]( https://www.odoo.com/web#id=3230087&cids=1&menu_id=4720&action=333&active_id=70&model=project.task&view_type=form) [upg-618789]( https://upgrade.odoo.com/web#id=618789&action=150&model=upgrade.request&view_type=form&cids=1&menu_id=107) While upgrading from 13.0 to 14.0, the mentioned db runs out of Memory (more specifically while computing the newly introduced `l10n_pe_edi_affectation_reason`): ``` Traceback (most recent call last): File "/home/odoo/src/odoo/14.0/odoo/
Original PR description
[OPW-3230087]( https://www.odoo.com/web#id=3230087&cids=1&menu_id=4720&action=333&active_id=70&model=project.task&view_type=form) [upg-618789](…
[OPW-3230087](
https://www.odoo.com/web#id=3230087&cids=1&menu_id=4720&action=333&active_id=70&model=project.task&view_type=form) [upg-618789](
https://upgrade.odoo.com/web#id=618789&action=150&model=upgrade.request&view_type=form&cids=1&menu_id=107)
While upgrading from 13.0 to 14.0, the mentioned db runs out of Memory (more specifically while computing the newly introduced `l10n_pe_edi_affectation_reason`):
```
Traceback (most recent call last):
File "/home/odoo/src/odoo/14.0/odoo/api.py", line 794, in get
return field_cache[record._ids[0]]
KeyError: 838760
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 972, in __get__
value = env.cache.get(record, self)
File "/home/odoo/src/odoo/14.0/odoo/api.py", line 797, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'account.move.line(838760,).exclude_from_invoice_tab'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/odoo/src/odoo/14.0/odoo/service/server.py", line 1201, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "/home/odoo/src/odoo/14.0/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/odoo/src/odoo/14.0/odoo/modules/loading.py", line 457, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "/home/odoo/src/odoo/14.0/odoo/modules/loading.py", line 349, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/home/odoo/src/odoo/14.0/odoo/modules/loading.py", line 199, in load_module_graph
registry.init_models(cr, model_names, {'module': package.name}, new_install)
File "/home/odoo/src/odoo/14.0/odoo/modules/registry.py", line 422, in init_models
env['base'].flush()
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5473, in flush
self.recompute()
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5932, in recompute
process(field)
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5916, in process
field.recompute(recs)
File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 1155, in recompute
self.compute_value(recs)
File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 1177, in compute_value
records._compute_field_value(self)
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 4078, in _compute_field_value
getattr(self, field.compute)()
File "/home/odoo/src/enterprise/14.0/l10n_pe_edi/models/account_move_line.py", line 42, in _compute_l10n_pe_edi_affectation_reason
if line.exclude_from_invoice_tab or not taxes_with_code:
File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 998, in __get__
recs._fetch_field(self)
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3071, in _fetch_field
self._read(fnames)
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3168, in _read
self.env.cache.update(fetched, field, values)
File "/home/odoo/src/odoo/14.0/odoo/api.py", line 812, in update
field_cache.update(zip(records._ids, values))
MemoryError
```
Changing the order of the `or` condition is enough to prevent that issue from happening, in this case.
More broadly speaking, since `taxes_with_code` is already locally available and `exclude_from_invoice_tab` needs to go through the ORM, I think it's better to check the former first - reducing the chances of calling the ORM.
Forward-Port-Of: odoo/enterprise#45787
Forward-Port-Of: odoo/enterprise#44644Steps to reproduce: - Install & configure Mexican localization - Install l10n_mx_edi_extended - Use a Mexican company - Go to Settings - Click on "Download XSD files (XML validation)" - Create an invoice with "External Trade" set to "Definitive" - Confirm the invoice - Process it with CFDI (4.0) E-invoicing service The following validation error occurs during the generation of the CFDI: ":22:0:ERROR:SCHEMASV:SCHEMAV_CVC_ELT_1: Element '{http://www.sat.gob.mx/ComercioExterior11}Comerc
Original PR description
Steps to reproduce: - Install & configure Mexican localization - Install l10n_mx_edi_extended - Use a Mexican company - Go to Settings - Click on "Download XSD files (XML validation)" - Create an…
Steps to reproduce:
- Install & configure Mexican localization
- Install l10n_mx_edi_extended
- Use a Mexican company
- Go to Settings
- Click on "Download XSD files (XML validation)"
- Create an invoice with "External Trade" set to "Definitive"
- Confirm the invoice
- Process it with CFDI (4.0) E-invoicing service
The following validation error occurs during the generation of the CFDI: ":22:0:ERROR:SCHEMASV:SCHEMAV_CVC_ELT_1:
Element '{http://www.sat.gob.mx/ComercioExterior11}ComercioExterior': No matching global element declaration available, but demanded by the strict wildcard."
Issue:
This error is triggered because it finds an element (i.e. ComercioExterior) that is not declared in the available XSD files.
When downloading the XSD files, "cfdv33.xsd" file is updated to add an import to all complementary XSD files.
But it is not the case for "cfdv40.xsd" file.
Solution:
Also update "cfdv40.xsd" file with all complementary XSD files.
opw-3353189
Forward-Port-Of: odoo/enterprise#45896Before this commit, the QUnit test `web_studio > Studio > Studio Navigation: error when new app's view is invalid` crashed undeterministically. This was because the error flow, that is managed in studio_action_container.js triggers another owl rendering. Sometimes the test finished before the new rendering finished, so both the error step and the contains assertions failed. Sometimes, the test finished just before the new rendering was in the DOM, but after the error was thrown. This commi
Original PR description
Before this commit, the QUnit test `web_studio > Studio > Studio Navigation: error when new app's view is invalid` crashed undeterministically. This was because the error flow, that is managed in studio_action_container.js triggers another owl rendering. Sometimes the test finished before the new rendering finished, so both the error step and the contains assertions failed. Sometimes, the test finished just before the new rendering was in the DOM, but after the error was thrown. This commit waits for `owl.App.afterNextRender` as it is a textbook use case for it. Local tests indicate those predictions: Without Fix: crashes 4% of the time (sample: 50) With Fix: crashes 0% of the time (sample: 150) runbot-error-20935 Forward-Port-Of: odoo/enterprise#46034 Forward-Port-Of: odoo/enterprise#45998
In case communication_company_id is not set on the sign request (it should be set by default to the current company), there would be an error when showing the signature interface (because controller self has no env attribute) since e2c3472f6a1646551c41ace761fc2df20304beca With this commit, as is done elsewhere in the module we use: - sign_request.communication_company_id - otherwise the company of the request creator - otherwise the logo.png route fallbacks on the current user company_id
Original PR description
In case communication_company_id is not set on the sign request (it should be set by default to the current company), there would be an error when showing the signature interface (because controller self has no env attribute) since e2c3472f6a1646551c41ace761fc2df20304beca With this commit, as is done elsewhere in the module we use: - sign_request.communication_company_id - otherwise the company of the request creator - otherwise the logo.png route fallbacks on the current user company_id opw-3427766 Forward-Port-Of: odoo/enterprise#45771
Steps to reproduce: - Install Accounting and configure Spanish localization - Create a contact (e.g. Contact X) - Create 4 invoices for Contact X and confirm them: * Amount: 1000€ - Invoice Date: 19/01/2022 * Amount: 1000€ - Invoice Date: 19/04/2022 * Amount: 1000€ - Invoice Date: 19/07/2022 * Amount: 1000€ - Invoice Date: 19/10/2022 - Go to Accounting / Reporting / Statement Reports / Tax Report - Select Report: Tax Report (Mod 347) (ES) - Select curtom dates from 01/01/2022 t
Original PR description
Steps to reproduce: - Install Accounting and configure Spanish localization - Create a contact (e.g. Contact X) - Create 4 invoices for Contact X and confirm them: * Amount: 1000€ - Invoice Date:…
Steps to reproduce: - Install Accounting and configure Spanish localization - Create a contact (e.g. Contact X) - Create 4 invoices for Contact X and confirm them: * Amount: 1000€ - Invoice Date: 19/01/2022 * Amount: 1000€ - Invoice Date: 19/04/2022 * Amount: 1000€ - Invoice Date: 19/07/2022 * Amount: 1000€ - Invoice Date: 19/10/2022 - Go to Accounting / Reporting / Statement Reports / Tax Report - Select Report: Tax Report (Mod 347) (ES) - Select curtom dates from 01/01/2022 to 31/03/2022 - Check line "B - Entregas de bienes y prestaciones de servicios superiores a 3.005,06 €" The line is empty. As the sum of all invoices of Contact X for the fiscal year 2022 is higher than 3005,06€ (i.e. 4000€), the amount of all invoices of Contact X for the filtered period should appear (i.e. 1000€). Cause: It is due to the fact that partners are excluded from the report if the sum of their invoices doesn't reach the threshold of 3005,06€ in the selected period, when the check to exclude partners should be based on the whole fiscal year. Solution: When computing the partners to exclude, the fiscal year is retrieved from the start date (selected in the report) and the computation is based on that fiscal year. In the particular case where the start and the end dates are from different fiscal years, nothing will be done (computation based on the selected dates). opw-3357320 Forward-Port-Of: odoo/enterprise#45439
Currently the way deferrals work, we expect the deferral to always start in the period of the move date. For the `at_validation` method, this caused the issue that no entry was generated for a single future period, since we assumed it was the same month as the move date and thus no deferral was needed. For the `manual` method, we could not create entries for a future single period, and also no intermediate entries to carry over the cost from the move period to the start period of the defer
Original PR description
Currently the way deferrals work, we expect the deferral to always start in the period of the move date. For the `at_validation` method, this caused the issue that no entry was generated for a single future period, since we assumed it was the same month as the move date and thus no deferral was needed. For the `manual` method, we could not create entries for a future single period, and also no intermediate entries to carry over the cost from the move period to the start period of the deferral. This commit fixes all the above issues and allows to both create deferrals for a single period via both methods, and allows to correctly defer the amounts from the move period to the start of the deferral period for the `manual` method. [task-3441429](https://www.odoo.com/web#id=3441429&menu_id=4720&cids=1&action=333&active_id=967&model=project.task&view_type=form) Forward-Port-Of: odoo/enterprise#45995 Forward-Port-Of: odoo/enterprise#44911
**Summary** Currently, when a report like the General Ledger is filtered using the search bar and then printed, the filter isn't being applied. As a result, the printed report includes all data, not just the filtered subset. **Steps to reproduce** * install `account_accountant` * open the General Ledger * filter the lines using the search bar * print the report You should see that everything is printed, instead of printing only the data that matches your filter. **Cause** Th
Original PR description
**Summary** Currently, when a report like the General Ledger is filtered using the search bar and then printed, the filter isn't being applied. As a result, the printed report includes all data, not just the filtered subset. **Steps to reproduce** * install `account_accountant` * open the General Ledger * filter the lines using the search bar * print the report You should see that everything is printed, instead of printing only the data that matches your filter. **Cause** The search filter functionality is currently only visual and doesn't impact the backend in any way. **Fix** The feature used to exist, and only stopped working when reports were converted to OWL. Thanks to this, everything necessary already exists in the backend. We just need to update the report options to include the `filter_search_bar` key. opw-3424432 opw-3436025 Forward-Port-Of: odoo/enterprise#45435
## Issue On account follow up we can set an SMS template whose model is not `res.partner`, and if in said template we try to access a field that is not of `res.partner`, we have an error when rendering the template when triggering a followup. We should prevent users from selecting templates that are not based on `res.partner`. ## Steps to reproduce - Install Accounting, SMS and another app (FSM for example) - Accounting > Configuration > Follow up levels > 15 days - Check SMS, set a templ
Original PR description
## Issue On account follow up we can set an SMS template whose model is not `res.partner`, and if in said template we try to access a field that is not of `res.partner`, we have an error when…
## Issue
On account follow up we can set an SMS template whose model is not `res.partner`, and if in said template we try to access a field that is not of `res.partner`, we have an error when rendering the template when triggering a followup. We should prevent users from selecting templates that are not based on `res.partner`.
## Steps to reproduce
- Install Accounting, SMS and another app (FSM for example)
- Accounting > Configuration > Follow up levels > 15 days
- Check SMS, set a template on it, on from FSM (so the model of the template is not `res.partner`).
- In the body add a reference to an attribute that is not present in `res.partner` for example {{object.origin}}
- Accounting > Customers > Follow-up Reports
- Select one of the entry that use the follow-up we modified
- Click on "Follow up", we are met with an error of failing to render the template.
## Cause
The Follow-up expects the template to be based on `res.partner`, but it's not the case always, because the user can set any sms template they want, regardless of the model. So when we access an attribute that doesn't exist on said model, we have a rendering failure of the template.
## Fix
Add a domain on `sms_template_id` on `FollowupLine` to force the model to be only `res.partner`. This is already the case in `AccountFollowupReport`.
## Affected versions
16 up to master
Reference:
opw-3372220
Forward-Port-Of: odoo/enterprise#45359This commit fixes a bug where the permission panel invite input would not be displayed if you managed to remove your edit user from a readonly article's members even though you are an admin. Now when you remove your edit member from a readonly article, the input stays visible if you are an admin. task-3458033 Forward-Port-Of: odoo/enterprise#45921 Forward-Port-Of: odoo/enterprise#45540
Original PR description
This commit fixes a bug where the permission panel invite input would not be displayed if you managed to remove your edit user from a readonly article's members even though you are an admin. Now when you remove your edit member from a readonly article, the input stays visible if you are an admin. task-3458033 Forward-Port-Of: odoo/enterprise#45921 Forward-Port-Of: odoo/enterprise#45540