Wednesday, December 4, 2024
38 changes · 18.0
Resolved issues and error corrections
This fixes an issue where masonry layout options on website pages could fail or behave incorrectly when a theme has imperfect markup. Website editors should now be able to select these layouts more reliably, reducing friction when customizing pages.
Original PR description
See design-themes commit for details. Related to task-4246355
Fixed a live chat chatbot issue where selecting an answer containing an ampersand could crash the conversation. This makes chatbot flows more reliable for customers and support teams using answers with special characters.
Original PR description
Before this commit, if chatbot had ampersamd character in question answers, this would lead to following crash: ``` Cannot read properties of undefined (reading 'id') ``` Steps to reproduce: -…
Before this commit, if chatbot had ampersamd character in question answers, this would lead to following crash: ``` Cannot read properties of undefined (reading 'id') ``` Steps to reproduce: - configure chatbot with following step scripts: ``` Message | step type | answers | only if ---------+-----------+---------------------------+---------------- step | question | "test & step 2", "step 3" | step 2 | text | | "test & step 2" step 3 | text | | "step 3" ``` - open conversation with chatbot - select "test & step 2" => crash This happens because when selecting an answer, chatbot detects the selected answer by comparing user message content with all possible answer text content. The message body of user is escaped, whereas chatbot answers are not. Thus `test & step 2` is not found and therefore the crash results in `answer.id` where `answer` is `undefined`. This commit fixes the issue by escaping the value of answer in the detection of selected answer by user, so that escaped content is compared with escaped content too. opw-4369966
A background check for outdated page data now runs silently as intended. This prevents unnecessary user-facing interruptions while keeping the system maintenance behavior unchanged.
Original PR description
The get_vacuum_info route was intended to be silent. However, silent should be passed in the "setting" parameter of the rpc method, not the "option" one. This PR fixes the issue.
The webclient test process was improved to reduce long runtimes and prevent freezes when dependencies are missing. This helps developers get faster feedback and keeps quality checks more reliable before changes reach users.
Original PR description
This PR includes several solutions to reduce the total runtime of the unit test suites in the webclient. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Generating a payment link for an invoice with no invoice lines no longer causes an error. The system now safely detects when there is nothing to pay, preventing disruption during invoice preparation.
Original PR description
Currently, an error occurs when generating a payment link for an invoice without add an invoice line. Step to produce: - Install the ```account_payment``` module. - Create a new invoice, Click on the…
Currently, an error occurs when generating a payment link for an invoice without add an invoice line.
Step to produce:
- Install the ```account_payment``` module.
- Create a new invoice, Click on the 'Actions' button, and try to generate a payment link.
See Traceback:
```
KeyError: 'amount_due'
File "odoo/http.py", line 2363, in __call__
response = request._serve_db()
File "odoo/http.py", line 1891, in _serve_db
return self._transactioning(
File "odoo/http.py", line 1954, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 137, in retrying
result = func()
File "odoo/http.py", line 1921, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2168, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 329, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 727, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 35, in call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 517, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "addons/web/models/models.py", line 867, in onchange
defaults = self.default_get(missing_names)
File "addons/payment/wizards/payment_link_wizard.py", line 22, in default_get
self.env[res_model].browse(res_id)._get_default_payment_link_values()
File "addons/account_payment/models/account_move.py", line 105, in _get_default_payment_link_values
amount_max = next_payment_values['amount_due']
```
An error occurs when the system attempts to get the next payment value at [1], But there is nothing to pay as an invoice line is not available.
Link [1]: https://github.com/odoo/odoo/blob/288d3926c5d011590aa25e9886cfa36377974dd6/addons/account_payment/models/account_move.py#L104-L105
To handle this issue, return an empty dictionary if the invoice line has not been added.
Sentry-6078809446
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prA previously disabled automated website sales test has been updated so it can run again. This helps catch issues in the online sales flow earlier, improving reliability without changing the customer-facing experience.
Original PR description
This tour has been disabled since October 15, 2024. In this commit, we make the necessary adaptations to reactivate the tour. runbot_error_id~99080 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 web test configuration was adjusted to allow JavaScript tests more time to complete. This helps reduce false failures in automated checks, making development and release validation more reliable without changing user-facing behavior.
This update makes Odoo's rich text editor more reliable by ensuring key editing features are always available to related tools. It also shares list item handling so comments and other editor features can work consistently in more places.
Original PR description
`position_plugin` and `input_plugin` don't share methods, but they offer features through resources that are pretty much essential for other plugins. In these cases, it makes sense to add them as a dependency. Knowledge `comments_plugins` needs a set of all nodes where it should be allowed to insert a new comment. `LI` element is part of it, and therefore `listItem` is exported for external use. task-4331264
This fixes a crash that could happen when debug-mode users opened an outgoing payment method line directly from bank journal settings and tried to edit the Payment Account field. The change keeps the accounting setup screen stable in this edge case, preventing an error caused by missing parent journal context.
Original PR description
Users in debug mode can click on a 'View' button in the list renderer
and open the specific record form view. However this may crash if the
model was not intended to be opened in a stand alone form view
Steps to reproduce:
- Go to debug mode
- Go to Accounting Dashboard
- Open Bank Journal settings
- Switch to Outgoing Payments tab
- in List menu options activate 'View Button'
- Click 'View' button
- Try to modify the 'Payment Account' field
Issue: Tracbeack will raise
```
Error: Name 'parent' is not defined
EvalError: Can not evaluate python expression: ((company_id and [('company_ids', 'parent_of', [company_id])] or [('company_ids', 'parent_of', '')]) + ([('deprecated', '=', False), '|', ('account_type', 'in', ('asset_current', 'liability_current')), ('id', '=', parent.default_account_id)]))
Error: Name 'parent' is not defined
```
opw-4233216This update fixes automated test tours across Point of Sale, Restaurant, Project, Website, and eLearning areas. It helps reduce false test failures, making future releases and maintenance more reliable without changing day-to-day user workflows.
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
This fix preserves the original database constraint definition when Odoo checks whether a constraint needs updating. It avoids unnecessary remove-and-recreate operations and prevents percent signs in constraints from being changed incorrectly, improving reliability during updates.
Original PR description
If we replace the original definition then the check between the existing definition and the original one will always fail, thus we are always removing and re-adding the same constraint.…
If we replace the original definition then the check between the existing definition and the original one will always fail, thus we are always removing and re-adding the same constraint. https://github.com/odoo/odoo/blob/5ba361ddffa757cf60968f37180c7fd1304b3fd4/odoo/models.py#L3209
Replacing `%` by `%%` works for `LIKE` operator because they are equivalent. Since they are sent as-is to the DB the constraint could actually be plainly wrong.
```sql
test_17=> SELECT coalesce(d.description, pg_get_constraintdef(c.oid))
FROM pg_constraint c
JOIN pg_class t
ON t.oid = c.conrelid
LEFT JOIN pg_description d
ON c.oid = d.objoid
WHERE t.relname = 'ir_model_fields'
AND conname = 'ir_model_fields_name_manual_field'
+------------------------------------------------+
| coalesce |
|------------------------------------------------|
| CHECK (state != 'manual' OR name LIKE 'x\_%%') |
+------------------------------------------------+
```
Example where the definition sent to the DB is wrong:
```py
class A(models.Model):
_inherit = "res.users"
_sql_constraints = [("test_constraint", "CHECK (login !~ '%')", "Cannot have % in login")]
```
```sql
test_17=> \d res_users
...
Check constraints:
"res_users_test_constraint" CHECK (login::text !~ '%%'::text)
...
```
Since 18.0, we adapt the `SQL` object so that composition with code containing '%' works and we accept single unescaped '%' if there is no arguments.
X-original-commit: 692ad8e8a969981c6171b7bef34dfee5f0b007f8
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prFixed an error that could prevent users from saving new subscription items from a recurring plan. This improves reliability for teams managing subscription offerings and avoids disruptive frontend error messages during setup.
Original PR description
Versions: - 18.0 Steps to Reproduce: - Go to Recurring Plan. - Click on the "Subscription Items" button. - Create a new item and save it. Issue: - An error occurs when saving a new subscription item. Cause: - create method of the sale.order.line model when ensure_one was called on an empty recordset. Solution: - Fixed a ValueError occurring in the create method of the sale.order.line model when ensure_one was called on an empty recordset. Added validation to prevent attempts to unpack values from an empty recordset, ensuring smoother operation during sales order line creation and preventing RPC errors in the frontend.
This fix prevents users from creating personal appraisal templates that appear in the shared official template list. Users who need their own content can instead keep it in a dedicated private knowledge sheet, reducing clutter and confusion for everyone.
Original PR description
To avoid everyone creating his own template and making noise in the official list. If a user want to use his own template he can have a dedicated and private knowledge sheet for that. task-4366949
Luxembourg payroll demo employee records now include the required identification information. This allows the DECSAL report to be created correctly when using demo data, improving testing and setup validation.
Original PR description
Added the "identification_id" to all the "hr.employee" records to ba able to create the "DECSAL" report Task: 4334816
The Documents app's deletion test flow was adjusted so it waits properly after a document is removed. This prevents a false warning caused by checking a record that no longer exists, making quality checks more reliable.
Original PR description
This commit addresses a warning triggered during the document delete tour. The issue occurred because the tour attempted to access a deleted record, resulting in an timing issue. A timeout was added to ensure proper synchronization between UI actions and record states. error :- 99347
Attendance-based contracts now keep a single work entry when an employee's attendance spans a lunch break. This avoids creating separate work entries around lunch and better reflects the actual attendance period.
Original PR description
For attendance based contract do not split generated work entries around lunch Steps --- * Create a running contract for some employee that uses a schedule with * `work_entry_source = 'attendance'` * Create an attendance overlapping lunch for the employee * (e.g 10:00 -> 20:00) * => 2 work entries are generated: * 10 - 12 * 13 - 20 * We want only one: 10 - 20 task-4252156
Miscellaneous changes
**Current behavior before PR:** Unread messages in a channel or chat are not marked as read when the user opens the channel in mobile view. This is due to `thread.markAsRead()` not being called since the focus on the composer is no longer triggered after [this commit](https://github.com/odoo/odoo/pull/176557/commits/9c552d1a194f1be75b98d06b4e7659ab21cd7d4e). **Desired behavior after PR is merged:** This commit resolves the issue by explicitly calling `thread.markAsRead()` when a chat or
Original PR description
**Current behavior before PR:** Unread messages in a channel or chat are not marked as read when the user opens the channel in mobile view. This is due to `thread.markAsRead()` not being called since the focus on the composer is no longer triggered after [this commit](https://github.com/odoo/odoo/pull/176557/commits/9c552d1a194f1be75b98d06b4e7659ab21cd7d4e). **Desired behavior after PR is merged:** This commit resolves the issue by explicitly calling `thread.markAsRead()` when a chat or channel is opened. Task-4320251 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187984
Before this commit, when sending a message in full composer to explicit recipients and message contains mentions, the resulting recipients of the message were only mentioned users. Steps to reproduce: - Open a form view with suggested recipient (e.g. any contacts with demo data) - Click "Send message" then full composer button ("expand" button) - Type `@Marc Demo` mention in the full composer text area - Click on "Send" => The new message shows envelope with only "Marc Demo" in the rec
Original PR description
Before this commit, when sending a message in full composer to explicit recipients and message contains mentions, the resulting recipients of the message were only mentioned users. Steps to…
Before this commit, when sending a message in full composer to explicit recipients and message contains mentions, the resulting recipients of the message were only mentioned users.
Steps to reproduce:
- Open a form view with suggested recipient (e.g. any contacts with demo data)
- Click "Send message" then full composer button ("expand" button)
- Type `@Marc Demo` mention in the full composer text area
- Click on "Send"
=> The new message shows envelope with only "Marc Demo" in the recipients, instead of "Marc Demo" and the suggested recipient.
This happens because when making a mention, the code to enrich the `partner_ids` of `mail.compose.message` was basically setting its content with mentions, without taking into account whether there were some explicit values with other means than with `@mention`.
This commit fixes the issue by adding mentions with the current value of `partner_ids`, so that mentions and explicit recipients are the resulting recipients of message as expected
Task-4366608
Forward-Port-Of: odoo/odoo#189369
Forward-Port-Of: odoo/odoo#189187Versions -------- - 17.0+ Enterprise: https://github.com/odoo/enterprise/pull/74626 >[!note] >Enterprise PR only adds a test. Steps ----- 1. Have a confirmed subscription; 2. go to subscription management in portal; 3. set or change payment method. Issue ----- The following email is sent: > A payment [...] amounting $ 0.00 for [...] has been confirmed. Cause ----- The `_reconcile_after_done` override in `sale` sends a payment succeeded mail for any sale order linked to
Original PR description
Versions -------- - 17.0+ Enterprise: https://github.com/odoo/enterprise/pull/74626 >[!note] >Enterprise PR only adds a test. Steps ----- 1. Have a confirmed subscription; 2. go to subscription…
Versions -------- - 17.0+ Enterprise: https://github.com/odoo/enterprise/pull/74626 >[!note] >Enterprise PR only adds a test. Steps ----- 1. Have a confirmed subscription; 2. go to subscription management in portal; 3. set or change payment method. Issue ----- The following email is sent: > A payment [...] amounting $ 0.00 for [...] has been confirmed. Cause ----- The `_reconcile_after_done` override in `sale` sends a payment succeeded mail for any sale order linked to a transaction that wasn't confirmed by that transaction. It currently assumes all the transactions in `self` are actual payment operations, as any `validation` gets filtered out in `_finalize_post_processing`, before `_reconcile_after_done` is called[^1]. This assumption no longer holds with `sale_subscription` installed, which also calls `_reconcile_after_done` on validation transactions to manage payment tokens linked to subscriptions[^2]. Solution -------- Filter out `validation` transactions before calling `_send_payment_succeeded_for_order_mail` on linked orders. opw-4169491 [^1]: https://github.com/odoo/odoo/blob/12de68d342b/addons/payment/models/payment_transaction.py#L998-L1003 [^2]: https://github.com/odoo/enterprise/blob/bbd1be56538/sale_subscription/models/payment_transaction.py#L135-L144 Forward-Port-Of: odoo/odoo#189419 Forward-Port-Of: odoo/odoo#188440
When we have products on delivery on a sale order: - we update delivered qties - create invoice - we diminish delivered qties - create invoice -> should be a refund We want this last refund to be linked with the first invoice. As there is only one, there is no doubt that the two should be linked. However, we only do this for the localizations where the link is absolutely required, which is KE (enterprise) and ES Ticketbai for now. We also make sure in Ticketbai that the field is
Original PR description
When we have products on delivery on a sale order: - we update delivered qties - create invoice - we diminish delivered qties - create invoice -> should be a refund We want this last refund to be linked with the first invoice. As there is only one, there is no doubt that the two should be linked. However, we only do this for the localizations where the link is absolutely required, which is KE (enterprise) and ES Ticketbai for now. We also make sure in Ticketbai that the field is sufficiently editable. 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#189256 Forward-Port-Of: odoo/odoo#187634
Problem: When a BoM has a different UoM than the product, it will calculate the number of cycles needed for the work order using the product’s UoM. However, during the cycle time calculation, it uses the BoM’s UoM to calculate the number of cycles used in the previous work orders. It then uses this cycle number calculation to calculate the duration of each cycle. This can cause the expected duration for a work order to be calculated incorrectly. Purpose: Changing the cycle time’s calculation
Original PR description
Problem: When a BoM has a different UoM than the product, it will calculate the number of cycles needed for the work order using the product’s UoM. However, during the cycle time calculation, it uses…
Problem: When a BoM has a different UoM than the product, it will calculate the number of cycles needed for the work order using the product’s UoM. However, during the cycle time calculation, it uses the BoM’s UoM to calculate the number of cycles used in the previous work orders. It then uses this cycle number calculation to calculate the duration of each cycle. This can cause the expected duration for a work order to be calculated incorrectly. Purpose: Changing the cycle time’s calculation to use the product’s UoM will make it consistent with the number of cycles calculation on the work order. Steps to Reproduce on Runbot: 1. Create a new storable product. 2. Create a BoM for this product, but set the UoM to Dozens. 3. Navigate to the Operations tab and add an operation. 4. Set the Duration Computation to Compute based on tracked time. 5. Create a manufacturing order and confirm it. 6. Navigate to the Work Orders tab, set the Real Duration to 20:00, and mark it as done. 7. Create a new manufacturing order. 8. Navigate to the Work Orders tab and observe the Expected Duration is 240:00. opw-4239248 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#189445 Forward-Port-Of: odoo/odoo#187649
Use the Safari browser (MacOS or iOS): - Open a record (e.g. a SO); - Go to an external website (e.g. [www.google.com](http://www.google.com/)); - Return to the record using the browser's back button; Before this commit, the editable fields were not rendered correctly (in the SO example, the delivery address, the invoicing address were empty). This is because Safari used the `bfcache` to restore the page, but Odoo wasn't designed to be compatible with this cache. Now, when the `bfcac
Original PR description
Use the Safari browser (MacOS or iOS): - Open a record (e.g. a SO); - Go to an external website (e.g. [www.google.com](http://www.google.com/)); - Return to the record using the browser's back button; Before this commit, the editable fields were not rendered correctly (in the SO example, the delivery address, the invoicing address were empty). This is because Safari used the `bfcache` to restore the page, but Odoo wasn't designed to be compatible with this cache. Now, when the `bfcache` is used to restore a page, we reload the current page, to be sure that all the elements have been rendered correctly. Note that, a similar issue has been solved similarly in [1]. [1]: https://github.com/odoo/odoo/commit/fd0c2a18ac469239fe5d9c837f2fee8aa33f846b task-4281443 Forward-Port-Of: odoo/odoo#189471 Forward-Port-Of: odoo/odoo#187854
Steps: - have an industry module with a monetary field and don't specify its currency_field - use that field in a view of the module - Try installing the module via the source (not a module import) -> Validation error, the field is not present on the model This happens because we verify if the registry is loaded or not, but when installing from the source, we instantiate a new registry. Since we don't specify a currency_field, the _instantiate_attrs method would return nothing and the m
Original PR description
Steps: - have an industry module with a monetary field and don't specify its currency_field - use that field in a view of the module - Try installing the module via the source (not a module import) -> Validation error, the field is not present on the model This happens because we verify if the registry is loaded or not, but when installing from the source, we instantiate a new registry. Since we don't specify a currency_field, the _instantiate_attrs method would return nothing and the monetray field would not be registered on the model. The issue didn't appear when importing the module because the registry is loaded at that time, so we don't enter the condition. Forward-Port-Of: odoo/odoo#189443
The rounding method 'HALF-UP' is confusing for regular users when they see it in the UI. Replacing the user-facing term by the less specific 'Nearest' is clearer, since people naturally expect that to round halves up. Also the other UI strings were in all caps and have been changed to capitalized strings. [opw-4266444](https://www.odoo.com/odoo/all-tasks/4266444) Related to https://github.com/odoo/enterprise/pull/73285 Forward-Port-Of: odoo/odoo#187209 Forward-Port-Of: odoo/odoo#186237
Original PR description
The rounding method 'HALF-UP' is confusing for regular users when they see it in the UI. Replacing the user-facing term by the less specific 'Nearest' is clearer, since people naturally expect that to round halves up. Also the other UI strings were in all caps and have been changed to capitalized strings. [opw-4266444](https://www.odoo.com/odoo/all-tasks/4266444) Related to https://github.com/odoo/enterprise/pull/73285 Forward-Port-Of: odoo/odoo#187209 Forward-Port-Of: odoo/odoo#186237
Right now, when a demo company is created, the demo products do not get taxes in that company. (even in the main company) It is because of https://github.com/odoo/odoo/pull/173803 It is treating however an exception case with tips that if a product does not have taxes in the initial company, we won't give it taxes in the new company. But this means that all demo data won't have taxes unless we put them explicitly at least in one company. That is why we explicitly put the taxes on demo da
Original PR description
Right now, when a demo company is created, the demo products do not get taxes in that company. (even in the main company) It is because of https://github.com/odoo/odoo/pull/173803 It is treating however an exception case with tips that if a product does not have taxes in the initial company, we won't give it taxes in the new company. But this means that all demo data won't have taxes unless we put them explicitly at least in one company. That is why we explicitly put the taxes on demo data, but provide some hooks for exception cases like tips (and combo products). 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#189039
### Steps to reproduce the issue: 1. With studio, add a signature field to the Expense Form 2. Create a new expense with a signature 3. Receive the following error: > File "[...]/odoo/addons/hr_expense/models/hr_expense.py", line 459, in _compute_same_receipt_expense_ids > same_receipt_ids.update(expenses_groupby_checksum[attachment.checksum]) > KeyError: <string of letters and numbers> ### Explanation: When a Binary field is assigned a value.`ir.attachment` is
Original PR description
### Steps to reproduce the issue: 1. With studio, add a signature field to the Expense Form 2. Create a new expense with a signature 3. Receive the following error: > File…
### Steps to reproduce the issue: 1. With studio, add a signature field to the Expense Form 2. Create a new expense with a signature 3. Receive the following error: > File "[...]/odoo/addons/hr_expense/models/hr_expense.py", line 459, in _compute_same_receipt_expense_ids > same_receipt_ids.update(expenses_groupby_checksum[attachment.checksum]) > KeyError: <string of letters and numbers> ### Explanation: When a Binary field is assigned a value.`ir.attachment` is automatically created and linked to said field through `res_field`. https://github.com/odoo/odoo/blob/9b440d5b07d9683d7f051baa98476b2977acba0f/odoo/fields.py#L2514-L2522 In the database, when retrieving attachments, those with `res_field` assigned are discarded from the query. https://github.com/odoo/odoo/blob/bfd7945d634bd4d46c4d62e93061581c6c5b09c1/odoo/addons/base/models/ir_attachment.py#L520-L526 During the creation of `hr.expense`, `attachment_ids` is assigned all attachments created and linked to it, in the cache, through `res_id`. https://github.com/odoo/odoo/blob/9b440d5b07d9683d7f051baa98476b2977acba0f/odoo/fields.py#L3290 Since saas-17.4, the compute method `_compute_same_receipt_expense_ids` has been added with a dependency on `attachment_ids`. If, during the creation, a Binary field has been assigned a value and `ir.attachment` created, the latter will still be linked to `attachment_ids` in the cache and found in the `filtered` method, while the `_read_group`, checking the database, will discard it due to `res_field` having a value. https://github.com/odoo/odoo/blob/6b8e07e36c6e6e283d21c2b5abd9a9dabf10fa4a/addons/hr_expense/models/hr_expense.py#L445-L454 Due to that difference between the cache and the database, an issue occurs when trying to retrieve the value from `ir.attachment`. ### Fix reasoning: `attachment_ids` has a domain attribute, but it is not correctly assigned. The value should be a List instead of a String. https://github.com/odoo/odoo/blob/9b440d5b07d9683d7f051baa98476b2977acba0f/odoo/fields.py#L2991 While this specific domain is not necessary for One2Many fields since it is already covered by the override in `get_domain_list`. https://github.com/odoo/odoo/blob/9b440d5b07d9683d7f051baa98476b2977acba0f/odoo/fields.py#L4497-L4498 We will keep it to make sure the cache is invalidated and `attachment_ids` is retrieved from the database. https://github.com/odoo/odoo/blob/bde4952255987cd21ceaabdf13f0a271b6ab10fa/odoo/models.py#L6889-L6894 opw-4293803 Forward-Port-Of: odoo/odoo#186897
Commit 1c96b8687d9b6b36eff98644ca084e4693718293 remove the field `l10n_din5008_addresses` but still test its existence in the report. It was replaced by XML template but changed `parter_id.commercial_partner_id` into `partner_id` that lead to a duplication of the delivery address on delivery slips for company following din5008 rules. OPW: 4217638 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confi
Original PR description
Commit 1c96b8687d9b6b36eff98644ca084e4693718293 remove the field `l10n_din5008_addresses` but still test its existence in the report. It was replaced by XML template but changed `parter_id.commercial_partner_id` into `partner_id` that lead to a duplication of the delivery address on delivery slips for company following din5008 rules. OPW: 4217638 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#188051
This change improves the invoice report by making the partner type label dynamic. It ensures that the label adapts correctly, enhancing flexibility and accuracy. **Description of the issue/feature this PR addresses:** The partner type label in the invoice report was previously static, which caused inconsistencies in cases where the label needed to reflect different partner types dynamically. **Current behavior before PR:** The partner type label in the invoice report is hardcoded, which
Original PR description
This change improves the invoice report by making the partner type label dynamic. It ensures that the label adapts correctly, enhancing flexibility and accuracy. **Description of the issue/feature this PR addresses:** The partner type label in the invoice report was previously static, which caused inconsistencies in cases where the label needed to reflect different partner types dynamically. **Current behavior before PR:** The partner type label in the invoice report is hardcoded, which does not adapt to specific partner configurations or custom scenarios. **Desired behavior after PR is merged:** The partner type label in the invoice report is dynamically computed based on the partner's type, ensuring it reflects the appropriate value for each invoice context. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#189318 Forward-Port-Of: odoo/odoo#188696
If we replace the original definition then the check between the existing definition and the original one will always fail, thus we are always removing and re-adding the same constraint. https://github.com/odoo/odoo/blob/5ba361ddffa757cf60968f37180c7fd1304b3fd4/odoo/models.py#L3209 Replacing `%` by `%%` works for `LIKE` operator because they are equivalent. Since they are sent as-is to the DB the constraint could actually be plainly wrong. ```sql test_17=> SELECT coalesce(d.description, p
Original PR description
If we replace the original definition then the check between the existing definition and the original one will always fail, thus we are always removing and re-adding the same constraint.…
If we replace the original definition then the check between the existing definition and the original one will always fail, thus we are always removing and re-adding the same constraint. https://github.com/odoo/odoo/blob/5ba361ddffa757cf60968f37180c7fd1304b3fd4/odoo/models.py#L3209
Replacing `%` by `%%` works for `LIKE` operator because they are equivalent. Since they are sent as-is to the DB the constraint could actually be plainly wrong.
```sql
test_17=> SELECT coalesce(d.description, pg_get_constraintdef(c.oid))
FROM pg_constraint c
JOIN pg_class t
ON t.oid = c.conrelid
LEFT JOIN pg_description d
ON c.oid = d.objoid
WHERE t.relname = 'ir_model_fields'
AND conname = 'ir_model_fields_name_manual_field'
+------------------------------------------------+
| coalesce |
|------------------------------------------------|
| CHECK (state != 'manual' OR name LIKE 'x\_%%') |
+------------------------------------------------+
```
Example where the definition sent to the DB is wrong:
```py
class A(models.Model):
_inherit = "res.users"
_sql_constraints = [("test_constraint", "CHECK (login !~ '%')", "Cannot have % in login")]
```
```sql
test_17=> \d res_users
...
Check constraints:
"res_users_test_constraint" CHECK (login::text !~ '%%'::text)
...
```
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#188593Problem --------- Additional attachments linked to an Email Template used in the Send & Print are completely ignored. They should not, and it's especially useful for Timesheets. Steps --------- 1. Install Accouting, Timesheet and Sales 2. In debug, access mail templates 3. Go to the 'Invoice: Sending' record > Setting tab 4. In Dynamic Reports, add 'Timesheet' 5. Go to sale 6. Create an SO with 'Junior Architect' product for 10 units 7. Confirm the SO 8. Click the Timesheet widget
Original PR description
Problem --------- Additional attachments linked to an Email Template used in the Send & Print are completely ignored. They should not, and it's especially useful for Timesheets. Steps --------- 1.…
Problem --------- Additional attachments linked to an Email Template used in the Send & Print are completely ignored. They should not, and it's especially useful for Timesheets. Steps --------- 1. Install Accouting, Timesheet and Sales 2. In debug, access mail templates 3. Go to the 'Invoice: Sending' record > Setting tab 4. In Dynamic Reports, add 'Timesheet' 5. Go to sale 6. Create an SO with 'Junior Architect' product for 10 units 7. Confirm the SO 8. Click the Timesheet widget on the SO form view 9. Register some hours for today (for example 3 hours) 10. On the SO Form view, click 'Create Invoice' 11. Select the option to invoice timesheeted hours and select from today to today as the date range 12. Create the Invoice and post 13. Send & Print -> The timesheet report appears in the send and print widget, when you click send, the timesheet report is actually not sent. Solution --------- 1. Add a placeholder in the send&print widget, the placeholders are stored in the `mail_attachments_widget` used for such purposes. The dynamic reports are defined with an new key: `dynamic_report` to differenciate them from the `manual` attachments and the invoice PDF. This new key eases the complexity to retreive and create the attachments fom the placeholders list. 2. Add a method when sending the mails to generate the dynamic reports only if the reports have not been removed in the S&P widget (`skip != False`). Since the attachments placed in the mails are a collection of elements from `mail_attachments_widget` that possess a valid attachment ID. We add the relevant attachment data in the mail_attachments_widget of the invoice. task-4283972 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187381
This revert commit 063e224c17c0e0194e5ade6acbe82ff38a669b54 Many customers don’t use the bank account field on the employee form, and the change was blocking for them. Enterprise: https://github.com/odoo/enterprise/pull/74769 task-4206895 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#189153 Forward-Port-Of: odoo/odoo#188956
Original PR description
This revert commit 063e224c17c0e0194e5ade6acbe82ff38a669b54 Many customers don’t use the bank account field on the employee form, and the change was blocking for them. Enterprise: https://github.com/odoo/enterprise/pull/74769 task-4206895 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#189153 Forward-Port-Of: odoo/odoo#188956
**Steps to reproduce the bug:** - Create a storable product “P1”: - Vendor: Azure Interior - Reordering rule: - Trigger: Auto - Route: Buy - Go to the user settings and give Marc Demo access only to Sales. - Log in as Marc. - Create a sales order: - Product: 1 unit of P1. - Confirm the SO. - A purchase order is created. - Create a second SO with another 1 unit of P1. - Confirm it. **Problem:** An error is triggered: `odoo.exceptions.AccessError: You are not al
Original PR description
**Steps to reproduce the bug:** - Create a storable product “P1”: - Vendor: Azure Interior - Reordering rule: - Trigger: Auto - Route: Buy - Go to the user settings and give Marc Demo access only to…
**Steps to reproduce the bug:**
- Create a storable product “P1”:
- Vendor: Azure Interior
- Reordering rule:
- Trigger: Auto
- Route: Buy
- Go to the user settings and give Marc Demo access only to Sales.
- Log in as Marc.
- Create a sales order:
- Product: 1 unit of P1.
- Confirm the SO.
- A purchase order is created.
- Create a second SO with another 1 unit of P1.
- Confirm it.
**Problem:**
An error is triggered:
`odoo.exceptions.AccessError: You are not allowed to access 'Purchase Order Line' (purchase.order.line) records.`
When the second SO is confirmed, a quantity request is made, triggering the "buy" rule. A check is made if there is a candidate “purchase order line” with the same specifications to update its quantity instead of creating a new one:
https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase_stock/models/stock_rule.py#L130-L136
The function `_update_purchase_order_line` is called, where access to the taxes associated with the purchase order line is attempted: https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase_stock/models/stock_rule.py#L248
Since it’s a Many2Many field, a query is made to fetch all the records. However, because the user does not have access to the `account.tax` model, an error is triggered.
opw-4193125
Forward-Port-Of: odoo/odoo#181242
Forward-Port-Of: odoo/odoo#181073Versions -------- - 17.0+ Community: https://github.com/odoo/odoo/pull/188440 >[!important] >All functional changes are made in `sale`, this PR simply adds a test. Steps ----- 1. Have a confirmed subscription; 2. go to subscription management in portal; 3. set or change payment method. Issue ----- The following email is sent: > A payment [...] amounting $ 0.00 for [...] has been confirmed. Cause ----- The `_reconcile_after_done` override in `sale` sends a payment succe
Original PR description
Versions -------- - 17.0+ Community: https://github.com/odoo/odoo/pull/188440 >[!important] >All functional changes are made in `sale`, this PR simply adds a test. Steps ----- 1. Have a confirmed…
Versions -------- - 17.0+ Community: https://github.com/odoo/odoo/pull/188440 >[!important] >All functional changes are made in `sale`, this PR simply adds a test. Steps ----- 1. Have a confirmed subscription; 2. go to subscription management in portal; 3. set or change payment method. Issue ----- The following email is sent: > A payment [...] amounting $ 0.00 for [...] has been confirmed. Cause ----- The `_reconcile_after_done` override in `sale` sends a payment succeeded mail for any sale order linked to a transaction that wasn't confirmed by that transaction. It currently assumes all the transactions in `self` are actual payment operations, as any `validation` gets filtered out in `_finalize_post_processing`, before `_reconcile_after_done` is called[^1]. This assumption no longer holds with `sale_subscription` installed, which also calls `_reconcile_after_done` on validation transactions to manage payment tokens linked to subscriptions[^2]. Solution -------- Filter out `validation` transactions before calling `_send_payment_succeeded_for_order_mail` on linked orders. opw-4169491 [^1]: https://github.com/odoo/odoo/blob/12de68d342b/addons/payment/models/payment_transaction.py#L998-L1003 [^2]: https://github.com/odoo/enterprise/blob/bbd1be56538/sale_subscription/models/payment_transaction.py#L135-L144 Forward-Port-Of: odoo/enterprise#75046 Forward-Port-Of: odoo/enterprise#74626
Forward-Port-Of: odoo/enterprise#74947 Forward-Port-Of: odoo/enterprise#74033
Original PR description
Forward-Port-Of: odoo/enterprise#74947 Forward-Port-Of: odoo/enterprise#74033
**Steps to reproduce:** - Install Accounting - Create a Branch company without COA - Switch to the Branch company - Go to "Accounting / Accounting / Management / Assets" - Create an asset - Try to select an account for "Fixed Asset Account", "Depreciation Account" or "Expense Account" **Issue:** The list is empty. The accounts from the parent company should be proposed. opw-4368887 Forward-Port-Of: odoo/enterprise#75034
Original PR description
**Steps to reproduce:** - Install Accounting - Create a Branch company without COA - Switch to the Branch company - Go to "Accounting / Accounting / Management / Assets" - Create an asset - Try to select an account for "Fixed Asset Account", "Depreciation Account" or "Expense Account" **Issue:** The list is empty. The accounts from the parent company should be proposed. opw-4368887 Forward-Port-Of: odoo/enterprise#75034
after this commit [1] the **Pagos** namespace was always removed from the schemaLocation attribute, this was causing error for Quarum pac. this commit fix the issue by filtering the schemaLocation attribute based what is present in namespace map. [1] https://github.com/odoo/enterprise/commit/dd18e0829810df7594730e14e09ac2174eedcc32 opw-4168509 Forward-Port-Of: odoo/enterprise#74904 Forward-Port-Of: odoo/enterprise#74809
Original PR description
after this commit [1] the **Pagos** namespace was always removed from the schemaLocation attribute, this was causing error for Quarum pac. this commit fix the issue by filtering the schemaLocation attribute based what is present in namespace map. [1] https://github.com/odoo/enterprise/commit/dd18e0829810df7594730e14e09ac2174eedcc32 opw-4168509 Forward-Port-Of: odoo/enterprise#74904 Forward-Port-Of: odoo/enterprise#74809
The rounding method 'HALF-UP' is confusing for regular users when they see it in the UI. Replacing the user-facing term by the less specific 'Nearest' is clearer, since people naturally expect that to round halves up. This commit adapts an error message to the new term. [opw-4266444](https://www.odoo.com/odoo/all-tasks/4266444) Related to https://github.com/odoo/odoo/pull/186237 Forward-Port-Of: odoo/enterprise#73804 Forward-Port-Of: odoo/enterprise#73285
Original PR description
The rounding method 'HALF-UP' is confusing for regular users when they see it in the UI. Replacing the user-facing term by the less specific 'Nearest' is clearer, since people naturally expect that to round halves up. This commit adapts an error message to the new term. [opw-4266444](https://www.odoo.com/odoo/all-tasks/4266444) Related to https://github.com/odoo/odoo/pull/186237 Forward-Port-Of: odoo/enterprise#73804 Forward-Port-Of: odoo/enterprise#73285
Steps to reproduce: - Insert a pivot from CRM - Create a global filter, with type date or text => The id field can be selected With this commit, field `id` is now available only on relational global filters. Task: 4348477 Forward-Port-Of: odoo/enterprise#75023 Forward-Port-Of: odoo/enterprise#74191
Original PR description
Steps to reproduce: - Insert a pivot from CRM - Create a global filter, with type date or text => The id field can be selected With this commit, field `id` is now available only on relational global filters. Task: 4348477 Forward-Port-Of: odoo/enterprise#75023 Forward-Port-Of: odoo/enterprise#74191