Tuesday, November 14, 2023
6 changes · 17.0
Enhancements to existing features
Knowledge now automatically saves your work when you click away from the document or switch windows. This improvement prevents the frustrating loss of unsaved changes by detecting when you've left the document and saving any modifications you've made.
Original PR description
This commit adds an autosave feature when the window detects a `focusout` event. This enables Knowledge to save more often in order to fix one of its biggest issue: the surprise loss of data. When we detect a `focusout` we call the method isDirty to check if the body has indeed been modified. If that's the case then we launch the save mechanism to commit the changes done to the Database. task-3531468
Resolved issues and error corrections
This fix resolves an issue where article content was being lost when users changed the visibility settings of a Workspace article. The problem was caused by the editor being reset after loading, which unintentionally removed the content. The fix ensures that content is properly saved before any visibility changes are applied.
Original PR description
**Before this PR**: - Changing the visibility of a Workspace article did not save the content, resulting in content loss. - In several functions `isDirty` function returns a pending promise, hence the `if conditions` are always calculated to be true. **Reason**: - The issue was caused by the behavior of the `resetEditor` function. From `_onChangeVisibility`, `resetEditor` function triggers after calling `load` function, which resulted in the unintentional removal of the article content. - `isDirty` has been changed from getter method to async function from PR https://github.com/odoo/odoo/commit/8723f020c3587a900c811b8cc23f53fe34b98df3 **After this PR**: Now article content is saved when visibility changes. **Task**-3491577
Fixed a crash that occurred when Italian users filtered the General Ledger report by Customer Invoices or Vendor Bills. The issue was caused by incorrect report configuration when localized tax reports were installed. The fix ensures the correct base report is selected, allowing users to filter by journal type without errors.
Original PR description
[FIX] account_reports : general ledger localization Issue: ====== In some countries (like Italy), with the corresponding l10n module installed, opening the General Ledger and selecting the "Customer…
[FIX] account_reports : general ledger localization Issue: ====== In some countries (like Italy), with the corresponding l10n module installed, opening the General Ledger and selecting the "Customer Invoices" or "Vendor Bills" journal in the filter crashes, telling the `report_id` of the computed options is inconsistent with the report using them. Steps to reproduce the issue: ============================= - Install accounting and l10n_it_reports - Go to accounting / reporting / general ledger - Choose customer invoices in journals Origin of the issue: ==================== When selecting only sales or purchase journals (not both together), the General Ledger displays additional lines corresponding to the data of the Generic Tax Report matching the chosen options. The way it was done in 16.4, however, let the tax report choose the first variant available for the current company, so if the l10n module contained a tax report, the wrong report was chosen and set in `report_id`, and we were calling the Generic Tax Report with an options dict whose `report_id` key corresponded to a localized variant instead of the root report. Solution: ========= Previous versions used to directly force the `report_id` key, but this does not work anymore because of the introduction of the composite reports (aka sections), and the way they changed the options generation. The key to force is now `selected_variant_id`, to make sure the root report is the one that gets selected. opw-3580078 Forward-Port-Of: odoo/enterprise#50399
This fix resolves a critical error that occurs when the EDI document processing system runs automatically. The issue was caused by using an underscore (_) as a variable name, which conflicts with Odoo's translation system. This fix renames the variable to prevent the system from crashing when processing electronic invoices for Ecuador.
Original PR description
Currently, an error occurs as below when cron 'EDI : Perform web services operations' runs. Error: ``` TypeError: 'str' object is not callable File "odoo/tools/safe_eval.py", line 365, in safe_eval…
Currently, an error occurs as below when cron
'EDI : Perform web services operations' runs.
Error:
```
TypeError: 'str' object is not callable
File "odoo/tools/safe_eval.py", line 365, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "ir.actions.server(615,)", line 1, in <module>
File "addons/account_edi/models/account_edi_document.py", line 256, in _cron_process_documents_web_services
nb_remaining_jobs = edi_documents._process_documents_web_services(job_count=job_count)
File "addons/account_edi/models/account_edi_document.py", line 243, in _process_documents_web_services
self._process_job(job)
File "addons/account_edi/models/account_edi_document.py", line 202, in _process_job
edi_result = method_to_call(moves)
File "home/odoo/src/enterprise/saas-16.4/l10n_ec_edi/models/account_edi_format.py", line 220, in _cancel_invoice_edi
return self._l10n_ec_cancel_move_edi(invoices)
File "home/odoo/src/enterprise/saas-16.4/l10n_ec_edi/models/account_edi_format.py", line 202, in _l10n_ec_cancel_move_edi
_("You cannot cancel a document that is still authorized (%s, %s), check the SRI portal",
ValueError: <class 'TypeError'>: "'str' object is not callable" while evaluating
'model._cron_process_documents_web_services(job_count=20)'
File "odoo/addons/base/models/ir_cron.py", line 373, in _callback
self.env['ir.actions.server'].browse(server_action_id).run()
File "home/odoo/src/custom/trial/saas_trial/models/sentry.py", line 33, in run
res = super().run()
File "odoo/addons/base/models/ir_actions.py", line 688, in run
res = runner(run_self, eval_context=eval_context)
File "odoo/addons/base/models/ir_actions.py", line 558, in _run_action_code_multi
safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True, filename=str(self)) # nocopy allows to return 'action'
File "odoo/tools/safe_eval.py", line 379, in safe_eval
raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))
```
This is because with the recently reflected https://github.com/odoo/enterprise/pull/49350 added [1],
which uses `_` as a variable,; in Odoo, `_`(_()) is used in translation, and it is a class, so we can't use
`_` as a variable.Also, this is causing the "local variable `_` referenced before assignment" error from [2]
because the '_l10n_ec_cancel_move_edi' method tries to access `_` before [1] when the above cron
runs or when a user requests a cancellation EDI.
This commit fixes the above issue by changing the variable name.
[1]-https://github.com/odoo/enterprise/blob/b1abcb7a5b075ccbb1409a5fb19c6b142bc6cf77/l10n_ec_edi/models/account_edi_format.py#L197 [2]-https://github.com/odoo/enterprise/blob/b1abcb7a5b075ccbb1409a5fb19c6b142bc6cf77/l10n_ec_edi/models/account_edi_format.py#L190
sentry-4608132760
Forward-Port-Of: odoo/enterprise#50353Fixed a critical issue where the bank reconciliation widget wasn't updating when transaction amounts were modified in the list view, which could result in incorrect journal entries being created. The system now properly refreshes the reconciliation display to reflect all changes made to transactions, ensuring accurate financial records.
Original PR description
The bank reconciliation kanban view is currently not updated after changes to transactions in the list view. This can lead to wrong (outdated) information to be shown on the right side in the bank…
The bank reconciliation kanban view is currently not updated after changes to transactions in the list view. This can lead to wrong (outdated) information to be shown on the right side in the bank reconciliation kanban view. This further allows creating wrong reconcilation journal entries with the "Validate" button (I.e. after a change to the "amount" of a transaction in the list view is not reflected on the right side of the bank reconciliation kanban view). The test tour was extended to test for this case. To reproduce: 1. Go to bank reconciliation (in kanban view) 2. Select some transaction kanban card that is not yet reconciled 3. Switch to the tree view 4. Modify the "amount" field of the transaction that was selected in step 2. This corresponds to a change in the database. 5. Switch back to kanban view 6. The right part of the UI (under the "Validate" button) is not updated: I.e. the top line (liquidity line) has a wrong debit / credit. 7. Validate 8. The journal entry created due the validation in step 7 uses the non-updated / wrong values and is thus wrong. task-3504471 PR on 16.0: https://github.com/odoo/enterprise/pull/47930 (very different code) Forward-Port-Of: odoo/enterprise#48175
This fix resolves an issue where direct messages couldn't be opened properly on Android and iOS mobile apps after a recent system update. The fix ensures that mobile apps receive the correct information to display direct messages in the proper view when users click on notifications.
Original PR description
* = test_mail_enterprise Since commit [1], the model `mail.channel` was renamed to `discuss.channel`. In our Mobile App (Android, iOS) we have a specific logic to handle opening a DM with the correct action related to this model. Due to this renaming, we were not able to open the action of the direct message on Android and iOS apps. Also, as we can't push change on `iOS`, we are not able to adapt the logic in the Mobile App (due to Apple Store Policies). This commit forces to send the old model to apply the correct logic on the Mobile App (Android, iOS). Steps to reproduce: * Send a DM to the Mobile App's user * The user clicks on the notification * The Mobile App opens but not in the correct view => BUG [1]: https://github.com/odoo/odoo/commit/90cb44e1e1b6bad9c12f3bd14d1c9e340461e19e Forward-Port-Of: odoo/enterprise#50520