Syncing from upstream odoo/odoo (staging.saas-19.4)#42346
Open
bt-admin wants to merge 118 commits into
Open
Conversation
Before this commit, on slow networks users could trigger a traceback by quickly selecting a form field and deleting it. This happened because code executed from `FormFieldOption` `onWillStart` assumed the form field element still existed after awaiting asyncronous functions. This also caused the tour `test_website_form_conditional_required_checkboxes` to occasionally fail on runbot. This commit hardens the method `FormOptionPlugin.loadFieldOptionData` against DOM mutations that may happen while awaiting asyncronous code. In particular, `fieldEl` is now validated after every await. The code is also optimized such that syncronous code relying on the existance of the form field element is executed before the asyncronous one. Note that this change would not be necessary inside builder actions, but it is required because the code is also executed from `FormFieldOption` `onWillStart` and `onWillChangeProps`. runbot-940447 closes #273095 Signed-off-by: Francois Georis (fge) <fge@odoo.com>
`_prepare_subscribe_data()` crashes with a `TypeError` when last is not an integer, as the comparison with `_bus_last_id()` is not type safe. Since [1], this can happen naturally: when `_bus_last_id()` returns 0 after a DB restore, `broadcast()` drops the payload due to a falsy check. The tab then stores "undefined" in localStorage, which `parseInt` turns into `NaN`, which JSON encodes as `null`, which the server receives as `None`. Fix the falsy check in `broadcast()` so 0 is not dropped, use `|| 0` instead of `?? 0` when reading localStorage so corrupted values are recovered, and fallback any non integer last to 0 on the server. [1]: #270317 closes #272868 Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
__To reproduce__ 1. Drop a popup on the website. 2. Click twice rapidly on the popup show/hide toggle in the sidebar. => The popup visibility will be in an inconsistent state compared to the toggle's eye icon. __Reason__ Bootstrap ignores any call to show/hide if the popup is still transitioning. __Fix__ - Set `_isTransitioning` to `false` to trick Bootstrap into firing the event regardless of its current state. - Consequently, when hide/show are triggered in quick succession, the modal can enter an inconsistent state with the `.show` class but a `display: none` style (hide removes `.show` immediately, show restores it with `display: block`, then hide applies `display: none` after the animation). To address this side effect of the first fix, dispatching a `transitionend` event before resetting `_isTransitioning` ensures Bootstrap completes its state transitions. __Note__ This commit also fixes `custom_popup_snippet`, which fails non-deterministically with the following error: `TypeError: Cannot read properties of undefined (reading 'after')` This error occurs when trying to add a popup inside another popup that never closes due to this bug. runbot-939039 closes #272749 X-original-commit: 2b5888f Signed-off-by: Francois Georis (fge) <fge@odoo.com>
**Issue** Quantity on subcontracted receipts could be overridden after running the scheduler. **Steps to reproduce** - Create a subcontracting product - Create a PO for 10 units of that product - Go to receipt and open Subcontracting Productions' - Change the quantity to 5 - Enable debug mode. - Run Inventory/Operations/Procurement: run scheduler - Return to the receipt -> The receipt quantity is reset to 10 instead of remaining at 5. **Cause** Since the refactor introduced in commit: fc66e2d, subcontracting receipt moves are no longer automatically picked when the production quantity is modified. In particular, this test case protects that behavior: https://github.com/odoo/odoo/blob/f7fb0a941d6bac39b7057db36f57be079559912c/addons/mrp_subcontracting/tests/test_subcontracting.py#L1629-L1631 When the scheduler runs: https://github.com/odoo/odoo/blob/f7fb0a941d6bac39b7057db36f57be079559912c/addons/stock/models/stock_rule.py#L731 it computes the moves to assign: https://github.com/odoo/odoo/blob/f7fb0a941d6bac39b7057db36f57be079559912c/addons/stock/models/stock_rule.py#L706-L710 However, subcontracting moves are still included in the assignment domain: https://github.com/odoo/odoo/blob/f7fb0a941d6bac39b7057db36f57be079559912c/addons/stock/models/stock_rule.py#L680-L688 https://github.com/odoo/odoo/blob/f7fb0a941d6bac39b7057db36f57be079559912c/addons/mrp/models/stock_rule.py#L127-L129 As a result, they are reassigned if they are not already picked: https://github.com/odoo/odoo/blob/f7fb0a941d6bac39b7057db36f57be079559912c/addons/stock/models/stock_move.py#L1931-L1937 opw-6229668 closes #272744 X-original-commit: 7e59d04 Signed-off-by: William Henrotin (whe) <whe@odoo.com> Signed-off-by: Maxime Noirhomme (noma) <noma@odoo.com>
This commit adds support for Android passkeys by introducing a `/.well-known/assetlinks.json` endpoint used by Android Digital Asset Links to associate the domain with the Android application. It also updates the authentication and registration flows to allow Odoo to accept requests originating from the mobile application. For Android, the expected origin format is: `android:apk-key-hash:BASE64(SHA256(APP_SIGNATURE))` Note: The `/.well-known/assetlinks.json` file must be served over HTTPS (port 443). Otherwise, Android Digital Asset Links validation will fail. Useful resources: * Digital Asset Links validation: https://digitalassetlinks.googleapis.com/v1/assetlinks:check?source.web.site=https://MY-DOMAIN.local&relation=delegate_permission/common.get_login_creds&target.android_app.package_name=com.odoo.mobile&target.android_app.certificate.sha256_fingerprint=D6:73:20:02:CA:2D:01:C9:FD:FC:94:73:5A:D0:73:CF:2C:36:10:29:1F:4B:F7:5D:91:C2:1D:37:B2:18:E8:91 * https://developers.google.com/digital-asset-links * https://developer.android.com/identity/passkeys/create-passkeys * https://developer.android.com/identity/credential-manager/prerequisites opw-6279212 closes #272743 X-original-commit: 844c96a Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Description of the issue this commit addresses: When a vendor bill is imported, then auto-completed from a purchase order, invoice lines, taxes, fiscal position, and payment terms can change. Existing EPD dynamic lines that lose their epd_key are skipped by sync and keep stale tax tags and amounts, causing mismatches between Invoice Lines and Journal Items. Desired behavior once this commit is merged: This commit makes EPD sync include keyless existing EPD lines so they are rewritten or removed during dynamic recomputation after PO auto-complete. Journal items remain consistent with the final invoice lines, taxes, and early discount configuration. opw-6047505 closes #272767 X-original-commit: be90a3f Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com> Signed-off-by: Thomas Becquevort (thbe) <thbe@odoo.com>
*: pos_stock In this commit: - Remove the `tracking` field from the HOOT test data. - Remove `test_order_unexisting_lots`, as it is already covered in `pos_stock`. - Move `test_order_existing_lot_gs1_nomenclature` from `point_of_sale` to `pos_stock`, where the stock-related behavior belongs. runbot-941084 closes #272768 X-original-commit: 3faffbc Signed-off-by: David Monnom (moda) <moda@odoo.com> Signed-off-by: Meet Jivani (meji) <meji@odoo.com>
*: website, website_mass_mailing __Problem__ In some cases, popup snippets can be dropped inside another popup. This shouldn't be possible. Moreover, it produces the following error: `TypeError: Cannot read properties of undefined (reading 'after')`. This can happen in multiple scenarios: - After saving a custom snippet, the snippets are reloaded but `disableUndroppableSnippets` is not called again, although the snippets should be filtered again. - `NewsletterPopupPlugin` registers `.o_newsletter_popup` in the `so_snippet_addition_selector` resource, bypassing the more restrictive `dropzone_selector` of `PopupOptionPlugin`. - Popups are not disabled when the cookie bar is open because we don't take `excludeAncestor` into account in `DisableSnippetsPlugin`. __Fix__ - Trigger an event whenever the snippets are loaded and call `disableUndroppableSnippets` when it is. - Remove the redundant `NewsletterPopupPlugin`. - Filter `dropAreaEls` with `excludeAncestor` in `DisableSnippetsPlugin`. closes #272770 X-original-commit: 19d165b Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com> Signed-off-by: Julien Launois (jula) <jula@odoo.com>
Module: l10n_it_pos Steps to reproduce: - In the POS settings, enable "Automatic Receipt Printing"; - Enable "ePos Printer" to make the "Skip Preview Screen" option appear; - Disable "Skip Preview Screen"; - Disable "ePos Printer"; - Set up an Italian Fiscal Printer; - Open a POS session and process a first order. Issue: After the first receipt, no other messages (price display, receipt, open register) are sent to the fiscal printer. A page reload is required. Cause: When "Automatic Receipt Printing" is true but "Skip Preview Screen" is false, a race condition occurs. `afterOrderValidation` triggers a print job while simultaneously transitioning to the `ReceiptScreen`. When the `ReceiptScreen` mounts, it triggers a second fiscal print job before the first has resolved. This creates a deadlock in `toHtml` of `renderService`, permanently blocking the printer queue. Solution: Since the italian localisation sending the receipt to the fiscal printer is mandatory, the printing route is now tied to the "Skip Preview Screen" option. opw-5979212 closes #272779 X-original-commit: 24612f1 Related: odoo/enterprise#122046 Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com> Signed-off-by: Thomas Schneider (thsc) <thsc@odoo.com>
Self-orders created from kiosk/mobile ordering were not displaying table information in the order details dialog because getTable() relies on table_id, while self-orders store the table reference in self_ordering_table_id. Add a fallback in getTable() to use self_ordering_table_id when table_id is not available and update getName() to properly handle floating orders. opw-6179516 closes #272785 X-original-commit: 7133bbc Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com> Signed-off-by: Dhruvrajsinh Zala (zadh) <zadh@odoo.com>
When a model has properties and a computed field or onchange depends on them, `record.update()` can be asynchronous (extra server RPC), which delays the DOM update. As a result, `PropertiesField` may be rendered before the RPC update finishes, so the property data is not yet available and this error can be raised: `TypeError: Cannot read properties of undefined (reading 'getRootNode')` This commit awaits the `record.update()` response before triggering the `PropertiesField` rendering, ensuring the property data is available. closes #272917 X-original-commit: 530b84e Signed-off-by: Romain Estievenart (res) <res@odoo.com>
Steps to reproduce: - Go to ToDo. - Create a code block using `/code`. - Place the cursor inside the code block. - Type `/table` and select the table command. - A traceback occurs. Purpose of this commit: - Commands and markdown shorthands should not be available inside code blocks. However, typing `/` inside a `<pre>` opened the command palette, allowing structural commands such as `/table` to be executed and causing a traceback. Similarly, markdown shorthands such as `* ` and `1.` were still active, unexpectedly transforming code content into lists. This commit fixes the issue by: - Disabling the command palette when the cursor is inside a `<pre>` element. - Disabling markdown shorthands inside `<pre>` elements by registering an `are_shorthand_available_predicates` predicate. task-6292231 closes #272861 X-original-commit: beb49fe Signed-off-by: David Monjoie (dmo) <dmo@odoo.com> Signed-off-by: Adnan Chaudhary (adch) <adch@odoo.com>
When importing an XML bill and linkin git to a purcahse order, the invoiced quantity may be computed incorrectly, due to a decimal precision mismatch. Steps to reproduce: - Import an XML bill having a line with quantity 1800.0 - Link to a purchase order with the same line Issue: The invoiced quantity will be computed with 1 cent difference (1800.01) Analysis: Because the system forced a decimal precision of 13 for 'Product Unit of Measure', quantity is imported as 1800.0000000000016. Later, when computing the invoiced quantity, the system round the quantity using 'UP' strategy, rounding the amount to 1800.01 opw-6194824 closes #272927 X-original-commit: f9389fc Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com> Signed-off-by: Laurent Smet (las) <las@odoo.com>
Currently, flexible employees can request a multi-day leave spanning a public holiday when the leave type includes public holidays in duration. However, requesting the public holiday date alone is rejected. Steps to reproduce: - Create a public holiday. - Create a time off type with "Public Holiday Included" enabled. - Select/create an employee with a flexible work schedule and its time zone must be same as admin. - Request a time off on the public holiday date only. Observed Behavior: The request is rejected because its duration is computed as 0 days. Expected Behavior: The request should be allowed and count as 1 day, consistent with the multi-day request behavior. Root Cause: At [1], a dedicated duration computation path is used for single-day leaves of flexible employees. This logic always retrieves overlapping public holidays and computes the leave duration based on the remaining intervals. As a result, a leave requested entirely on a public holiday is computed as 0 days, even when `include_public_holidays_in_duration` is enabled. [1]: https://github.com/odoo/odoo/blob/242f6d3cf7288853f163ac6986a3b7aa4279efaf/addons/hr_holidays/models/hr_leave.py#L437-L444 Fix: This commit ensures that the `include_public_holidays_in_duration` setting is taken into account when computing single-day leave durations for flexible employees opw-6284768 closes #272751 X-original-commit: 195f347 Signed-off-by: Romain Carlier (romc) <romc@odoo.com> Signed-off-by: Het Patel (path) <path@odoo.com>
…nippet Currently, an error occurs when a user insert a dynamic product snippet onto website. Steps to Reproduce: - Install website_sale without demo data. - Go to Website > eCommerce > Products > Ribbons. - Open any ribbon and set Assign to When New. - Go to the website > Edit > drag and drop the Catalog block, and select a Dynamic Product block (Generic Product Template (customizable)). TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'bool' After this [recent commit], when a user drops a dynamic product snippet, the system attempts to set the ribbon value [1]. If no product records are available, it falls back to using sample products [2]. These sample products are virtual records created with model.new() [3] [4] and are not stored in the database, so they do not have a publish date. When auto-assigned ribbon with the When New option assign, the system compares the ribbon's new period with the product's publish date. Since the sample products do not have a publish date, this comparison raises an error [5]. This commit ensures that the comparison between new period and publish date is only performed when the product has a valid publish_date. [recent commit]: f427f79 [1]: https://github.com/odoo/odoo/blob/b70330df7dc2017ab592b075c8ad8e048f671d90/addons/website_sale/templates/snippets/product_snippet_template_data.xml#L52-L58 [2]: https://github.com/odoo/odoo/blob/b70330df7dc2017ab592b075c8ad8e048f671d90/addons/website/models/website_snippet_filter.py#L75-L78 [3]: https://github.com/odoo/odoo/blob/b70330df7dc2017ab592b075c8ad8e048f671d90/addons/website/models/website_snippet_filter.py#L214-L215 [4]: https://github.com/odoo/odoo/blob/b70330df7dc2017ab592b075c8ad8e048f671d90/addons/website_sale/models/website_snippet_filter.py#L62-L95 [5]: https://github.com/odoo/odoo/blob/b70330df7dc2017ab592b075c8ad8e048f671d90/addons/website_sale/models/product_ribbon.py#L121-L124 sentry-7528296918 closes #272860 X-original-commit: 19142e7 Signed-off-by: Ashutosh Sharma (assh) <assh@odoo.com>
… operaton type Steps to reproduce: - In the settings enable: Multi-Steps Routes - Put your warehouse in delivery in 2 steps - On the receipt operation type change the return operation type to be "pick" by default. - Create and confirm a PO for 1 unit of P - Validate the receipt > return > Create the return for 1 unit - Change the operation type of the return from Pick to Delivery to return the product in one step. - Validate the return > The qty_received is updated from 1 to 2 instead of 0. Cause of the issue: Updating the `picking_type_id` of the return will also update the `location_dest_id` to the default values: https://github.com/odoo/odoo/blob/89807c10c20fb533124b18815f307fc3c380528d/addons/stock/models/stock_picking.py#L1138-L1147 However, the default values of the `Delivery` is "Partner/customer". As such, the location dest of the move is also updated to be "Partner/customer". Now the issue is that the `qty_received` only considers moves to be returned if the location dest usage is not 'supplier': https://github.com/odoo/odoo/blob/89807c10c20fb533124b18815f307fc3c380528d/addons/purchase/models/purchase_order_line.py#L226-L231 https://github.com/odoo/odoo/blob/89807c10c20fb533124b18815f307fc3c380528d/addons/purchase_stock/models/purchase_order_line.py#L55-L67 https://github.com/odoo/odoo/blob/89807c10c20fb533124b18815f307fc3c380528d/addons/purchase_stock/models/purchase_order_line.py#L76-L77 https://github.com/odoo/odoo/blob/89807c10c20fb533124b18815f307fc3c380528d/addons/purchase_stock/models/stock_move.py#L129-L131 opw-6292918 closes #272930 X-original-commit: 109fc19 Signed-off-by: William Henrotin (whe) <whe@odoo.com> Signed-off-by: Lancelot Semal (lase) <lase@odoo.com>
Making the test only depend on one class setup to avoid potential (already present) multicompany issues. In this case the env.user came from one setup class but was incompatible to use during the setup of the second class that was creating records for another company. By making the test only depend on one of the tests we'll avoid this issue. runbot-939375 closes #272758 X-original-commit: a7f5275 Signed-off-by: Sarah Bellefroid (sbel) <sbel@odoo.com>
Version: - 19.0 Steps to reproduce: - Create a rule of Timing type. - Add a tolerance for the employer. - Set the ruleset on the employee. - Add an attendance of less than the tolerance. Issue: - When using a Timing type rule with employer tolerance, overtime is still created even if the attendance is below the tolerance limit. Cause: - The timing rule calculation was missing the tolerance check that exists in the quantity rule calculation. Fix: - Added the missing tolerance check in the timing rule calculation. - Removed employee tolerance from view for timing rules. Task-6064081 closes #272784 X-original-commit: f7aa295 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When loading products in the POS, both the sale price and the cost were converted to the POS currency using `currency_id`. However a product stores its sale price and its cost in two potentially different currencies: `currency_id` (company currency, falling back to the main company) and `cost_currency_id` (company currency, falling back to the current company). opw-6297452 closes #272786 X-original-commit: 12bd81a Signed-off-by: Stéphane Vanmeerhaeghe (stva) <stva@odoo.com> Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
In the ticket screen, clicking an order line selected it for refund and incremented its quantity without checking whether the line could actually be refunded. As a result, a refund order (whose lines carry a negative quantity) could itself be refunded, and already fully refunded lines could be refunded again. opw-6314527 closes #272777 X-original-commit: efb1045 Signed-off-by: Stéphane Vanmeerhaeghe (stva) <stva@odoo.com> Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Attempt at fixing the following race condition. It's not clear what causes it, but these changes make the test more robust and might help future investigations. discuss_channel_public_tour opens the composer "More Actions" menu to attach files but feeds the hidden file input directly, so the menu is never closed and is still open when Send is clicked. Close it and wait for it to disappear before sending, to avoid clicking Send while the dropdown is dismissing. Also fix _open_group_page_as_user, which updated the last message body of self.channel instead of self.group between the two tour runs. https://runbot.odoo.com/odoo/error/243436 closes #273166 X-original-commit: 0cc3904 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
### Contains the following commits: odoo/o-spreadsheet@e359501309 [REL] 19.4.1 [Task: 0](https://www.odoo.com/odoo/2328/tasks/0) odoo/o-spreadsheet@5adffa5ca1 [FIX] config: bump node version in GH action [Task: 0](https://www.odoo.com/odoo/2328/tasks/0) odoo/o-spreadsheet@feea883b1d [IMP] pivot: give full dimension to pivot normaliser [Task: 6023622](https://www.odoo.com/odoo/2328/tasks/6023622) Part-of: #273240 Signed-off-by: Rémi Rahir (rar) <rar@odoo.com> Co-authored-by: Florian Damhaut (flda) <flda@odoo.com> Co-authored-by: Anthony Hendrickx (anhe) <anhe@odoo.com> Co-authored-by: Alexis Lacroix (laa) <laa@odoo.com> Co-authored-by: Lucas Lefèvre (lul) <lul@odoo.com> Co-authored-by: Adrien Minne (adrm) <adrm@odoo.com> Co-authored-by: Ronak Mukeshbhai Bharadiya (rmbh) <rmbh@odoo.com> Co-authored-by: Dhrutik Patel (dhrp) <dhrp@odoo.com> Co-authored-by: Rémi Rahir (rar) <rar@odoo.com> Co-authored-by: Pierre Rousseau (pro) <pro@odoo.com> Co-authored-by: Vincent Schippefilt (vsc) <vsc@odoo.com> Co-authored-by: Marceline Thomas (matho) <matho@odoo.com>
Model `account.root` has a string id. In spreadsheet, the normalisation process assumes that all many2one ids are numbers, which is not the case for this model. As we do not have any way to know it from server side, we introduce a list of models with string ids, and we use it in the normalisation process. Task: 6023622 Part-of: #273240 Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
### Contains the following commits: odoo/o-spreadsheet@e359501309 [REL] 19.4.1 [Task: 0](https://www.odoo.com/odoo/2328/tasks/0) odoo/o-spreadsheet@5adffa5ca1 [FIX] config: bump node version in GH action [Task: 0](https://www.odoo.com/odoo/2328/tasks/0) odoo/o-spreadsheet@feea883b1d [IMP] pivot: give full dimension to pivot normaliser [Task: 6023622](https://www.odoo.com/odoo/2328/tasks/6023622) closes #273240 Signed-off-by: Rémi Rahir (rar) <rar@odoo.com> Co-authored-by: Florian Damhaut (flda) <flda@odoo.com> Co-authored-by: Anthony Hendrickx (anhe) <anhe@odoo.com> Co-authored-by: Alexis Lacroix (laa) <laa@odoo.com> Co-authored-by: Lucas Lefèvre (lul) <lul@odoo.com> Co-authored-by: Adrien Minne (adrm) <adrm@odoo.com> Co-authored-by: Ronak Mukeshbhai Bharadiya (rmbh) <rmbh@odoo.com> Co-authored-by: Dhrutik Patel (dhrp) <dhrp@odoo.com> Co-authored-by: Rémi Rahir (rar) <rar@odoo.com> Co-authored-by: Pierre Rousseau (pro) <pro@odoo.com> Co-authored-by: Vincent Schippefilt (vsc) <vsc@odoo.com> Co-authored-by: Marceline Thomas (matho) <matho@odoo.com>
When an access contains a domain `('comodel_id', 'access', 'read')`, the
model is not accessible for the group on that access. Instead, it is the
intersection of the implied groups and the groups that give access to
the comodel.
closes #271100
Signed-off-by: Raphael Collet <rco@odoo.com>
Commit 8df8b4f moved the check for selection inside `[data-prevent-closing-overlay]` to the `closeToolbar` plugin. But when this function is called from `selection_leave_handlers` it should not do that check, as it was done for the focus or click. This commit skips the check based on the selection when `closeToolbar` is called by `selection_leave_handlers`. Steps to reproduce: - Open website builder - Drop "Text Image" snippet - Select some text in the snippet - Click on the trash icon in the sidebar to remove the snippet - Bug: the toolbar is still shown task-6308364 closes #272862 X-original-commit: 3fe9289 Signed-off-by: Robin Lejeune (role) <role@odoo.com> Signed-off-by: Sébastien Blondiau (blse) <blse@odoo.com>
The 'Inventory at Date' wizard was opening a basic product list view (view_stock_product_tree) that lacks the action buttons and columns available in the stock report view. Now it opens the full stock report view (product_product_stock_tree) with the matching search view, giving users the same rich interface (On Hand, Free to Use, Incoming, Outgoing, History, Replenishment, Locations, Forecast buttons) when viewing inventory at a past date. task-6152466 closes #272828 X-original-commit: 74ced12 Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Currently, an error occurs when a user tries to create a group time off. Steps to Reproduce: - Install the hr_presence module without demo data. - Make sure there are at least two employee records. - Go to Employees and switch to the list view. - Select both employees > click Presence Control > click Create a Time Off. Error1: TypeError: unsupported operand types in: hr.work.entry.type() | None Erro2: AttributeError: 'NoneType' object has no attribute 'ids' When a user creates a group time off record and the wizard is opened, it computes the valid work entry types. If no work entry type exists, accessing the `True` key (`requires_allocation`) from the empty dictionary returns None [1]. Later, when performing a union (|) between an empty work entry type recordset and None, it raises the first error [2]. Additionally, accessing ids on None raises the second error [3]. This commit ensures that when no work entry type exists, accessing key(requires_allocation) from an empty dictionary returns an empty work entry type record instead of None. [1]: https://github.com/odoo/odoo/blob/374f48cfba75ff98f53d8c3fcc51847711bd406a/addons/hr_holidays/wizard/hr_leave_generate_multi_wizard.py#L144-L145 [2]: https://github.com/odoo/odoo/blob/374f48cfba75ff98f53d8c3fcc51847711bd406a/addons/hr_holidays/wizard/hr_leave_generate_multi_wizard.py#L146 [3]: https://github.com/odoo/odoo/blob/374f48cfba75ff98f53d8c3fcc51847711bd406a/addons/hr_holidays/wizard/hr_leave_generate_multi_wizard.py#L148 sentry-7552717400 closes #273320 X-original-commit: 95dfc8a Signed-off-by: Mathias Lebel (lebm) <lebm@odoo.com> Signed-off-by: Ashutosh Sharma (assh) <assh@odoo.com>
df6eaed to
8672c39
Compare
Currently an error occurs when user opens stock report after uninstalling mrp.
Steps to replicate:
- Install mrp.
- Uninstall mrp and open `Stock > Reporting > Stock`.
Error:
```
ValueError: Invalid field product.product.is_kits in condition ('is_kits', '=', False)
```
Cause:
- The `mrp` module overrides the `stock.action_product_stock_view` window action
domain with `is_kits` field referenced inside [1].
- When mrp is uninstalled, the `is_kits` field is removed from `product.product`
but the overridden action domain remains stored in the database. Opening the
action then tries to evaluate a domain referencing a non-existent field,
resulting in this error.
Solution:
- Restore the original `stock.action_product_stock_view` domain during mrp
uninstallation to remove the `is_kits` condition.
[1]: https://github.com/odoo/odoo/blob/c8390638cae4b4dafb805bc0d3a4149fb5194934/addons/mrp/views/product_views.xml#L164-L166
sentry-7332688253
closes #273242
X-original-commit: 2a2a2c9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Bhavya Ashesh Nanavati (bhna) <bhna@odoo.com>
Opening "Change Layout" during a call adds a dialog via the dialog service. When the call was removed by the server (e.g. the `discuss.channel.rtc.session/ended` notification tears down the call and runs `endCall()`), the dialog stayed open. Clicking any option then ran `onSelectLayout`, which operates on the now-gone call (`channel.setAsDiscussThread()`, `rtc.enterFullscreen()`), and crashed. The action's `isSelfInCall` condition only gates opening a new dialog, never dismisses one already up. Close the dialog reactively when the user is no longer in the call, using Owl's reactive effect on `channel.isSelfInCall`, the same way `MessageReactionMenu` closes itself once its message loses all reactions. task-6352477 closes #273288 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Sometimes the tour runner is trying to open the history dialog before Owl have received and updated the record data. This create an error, because the history dialog think there's no data to display. To avoid this issue, we add a step to ensure the Owl renderer has finished loading and populating the record data into the form view, before opening the history dialog. runbot-243510 closes #273353 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The [related PR] introduced this santization check for invalid html in xml templates. However, it considers commits on empty knowledge articles as invalid HTML, causing an empty code view to be rendered which breaks some tests. Instead, we should consider an empty string as valid HTML. Related PR: #260405 Backport Of: #271882 runbot-937767 closes #273556 Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Steps to reproduce: - Open the website configurator in Chrome. - Choose an industry and reach the Layout step. - Look at the theme preview cards. => Thin gaps can appear between adjacent sections. Before this commit, Chrome could show 1px gaps in configurator theme previews when the `iframe` was scaled down. This came from a known rendering issue with fractional transforms [1]. A similar issue was already fixed for website pages built with the Website Builder when using background shapes [2]. That fix uses JS to adjust each `.o_we_shape` size. In the configurator, previews are static and small, so a local CSS overlap is enough and avoids running layout calculations for each preview `iframe`. After this commit, configurator previews add a small overlap on sections and shapes, so Chrome no longer exposes the background seam. [1]: https://issues.chromium.org/issues/41137778 [2]: f7fd40d task-6340483 closes #272748 Signed-off-by: Francois Georis (fge) <fge@odoo.com>
An employee that created his expense was only able to add attachments and post message in the chatter when the expense was in draft. After this, it will still be able to attach attachment and post message without having the right to edit the expense. This is better as the employee will be able to answer questions that have been asked or add more proof if required. task-4966942 X-original-commit: 73d4f76 Part-of: #273508 Signed-off-by: Julien Alardot (jual) <jual@odoo.com> Signed-off-by: Léo Leclerc (leol) <leol@odoo.com>
If a user tries to submit an expense without having a manager, this will fail with "You are neither a Manager nor a HR Officer". To fix this, we are not going to check when the manager is the user that expense is linked to. closes #273508 X-original-commit: b98f556 Signed-off-by: Julien Alardot (jual) <jual@odoo.com> Signed-off-by: Léo Leclerc (leol) <leol@odoo.com>
The actual extraction hardcoded the double-zipped case by reading only the first entry of the outer zip (zip_file.infolist()[0]), assuming it was always a nested zip containing the XML. This made it fail when: - The XML was directly in the outer zip (single-zipped). - The zip contained multiple files and the first nested zip didn't hold the XML. The fix rewrites extract_xml_from_zip to actually handle finding XML files in the outer and inner ZIPs. closes #273262 X-original-commit: 4f532f4 Signed-off-by: Josse Colpaert (jco) <jco@odoo.com> Signed-off-by: Vincent Sevestre (vise) <vise@odoo.com>
E-reporting technical fields were displayed directly on invoices, adding noise for regular invoicing users. Hide the e-reporting status columns and technical block from the standard invoice views. Log the relevant e-reporting flow, status and blocking errors in the invoice chatter instead, with a link to the related flow. Also avoid reporting address validation errors on B2C invoices, as they are not required for Flux 10 e-reporting. Task-6273226 closes #273560 X-original-commit: 36c5d4c Signed-off-by: Jérémy Bazin (baje) <baje@odoo.com>
Description of the issue: - When an emoji shortcut ending with '/' (e.g. ':/' for 😕) is typed, the emoji plugin replaces the characters before the powerbox `on_input_handler` runs. Since `ev.data` still reflects the original typed '/', the powerbox was incorrectly opening. After this commit: - Check the DOM character at cursor position instead of ev.data to determine whether '/' is actually present before opening the powerbox. task-6243724 X-original-commit: ba46eb1 Part-of: #273443 Related: odoo/enterprise#122523 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com> Signed-off-by: Samit Bharatbhai Bhadiyadra (sbbh) <sbbh@odoo.com>
Description of the issue: - Emoji shortcuts works only when it is used at the end of a text node, because the matching logic checked the whole remaining substring from the current position. - Sometimes, pressing Backspace splits one text node into two, and then an emoji shortcut works at the end of the first text node even when the paragraph is visible as a single line. After this commit: - Emoji shortcuts now works when used with a preceding space anywhere in the paragraph. task-6243724 closes #273443 X-original-commit: 22602fb Related: odoo/enterprise#122523 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com> Signed-off-by: Samit Bharatbhai Bhadiyadra (sbbh) <sbbh@odoo.com>
Before this commit the error "Transaction could not be created" was thrown when the transaction could not be created. This commit changes the behavior to throw the actual error that caused the transaction creation to fail, providing more context for debugging. closes #273501 X-original-commit: faa1df4 Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com> Signed-off-by: David Monnom (moda) <moda@odoo.com>
**Steps to reproduce on a new db:** (bug also reproducable on runbot but the impact is less easy to compute because of influence of other existing companies) - create a new company as company 2 and use the existing default company as company 1. - create a warehouse for both companies - for both comp, in settings for the 'fiscal localization' set Package : Generic Chart of account, if not already set (to have account journals). - for both comp, in settings for inventory valuation set 'periodic' and for periodic valuation set 'daily' From company 1 : - create a storable product with standard price method and set a cost of 30 - set an onhand quantity of 1 if you navigate to 'inventory valuation' you'll see that : - initial balance is 0 - ending stock is 30 - the variation lines have a balance of 30 - all of this is expected From company 2 : - change the cost of the product to 10 - set an onhand quantity of 1 if you navigate to 'inventory valuation' you'll see that : - initial balance is 0 - ending stock is 10 - the variation lines have a balance of 10 - all of this is expected From any company : - navigate to 'scheduled actions' and select the action 'Stock Account: Inventory Valuation Closing' - click on 'Run Manually' - navigate to 'inventory valuation' **Current behavior:** with company 1 selected : - the initial balance is now 30 - ending stock still 30 - no variation lines - the initial balance was correctly increased by the closing entry with company 2 selected: - the initial balance is now 40 - the ending stock is still 10 - the variation lines credit 30 in stock valuation In company 2 the closing entry debitted 40 in stock valuation instead of 10 which increased the initial balance to 40 instead of 10 If you open the journal items you'll find the closing amls have a balance of 40 instead of 10 **Cause of the issue:** The _cron_post_stock_valuation() method calls action_close_stock_valuation() on both companies https://github.com/odoo/odoo/blob/bfa39854e56da4bf23295d62f63d66973ad0d78e/addons/stock_account/models/res_company.py#L143-L144 This methods calls _action_close_stock_valuation with a context modified with only self.env.company.ids in 'allowed_company_ids' https://github.com/odoo/odoo/blob/bfa39854e56da4bf23295d62f63d66973ad0d78e/addons/stock_account/models/res_company.py#L56 This is needed because inside stock_value() we use the total value of the product https://github.com/odoo/odoo/blob/bfa39854e56da4bf23295d62f63d66973ad0d78e/addons/stock_account/models/res_company.py#L92 which will be the sum of the values of the product for each company inside allowed_company_id https://github.com/odoo/odoo/blob/bfa39854e56da4bf23295d62f63d66973ad0d78e/addons/stock_account/models/product.py#L274 So in case action_close_stock_valuation() was called from the 'generate entry' button from the inventory valuation view we need only the main company selected to be in the 'allowed_company_ids' so that the inventory value is computed based only on this company (as is the accounting value). The problem is that this does not work when calling the method from _cron_post_stock_valuation because then there is no 'allowed_company_ids' in the context (because it was called from _process_job() with a new env). so self.env.company will be the company of the user which will be company 1. https://github.com/odoo/odoo/blob/bfa39854e56da4bf23295d62f63d66973ad0d78e/odoo/orm/environments.py#L243 Therefore when _action_close_stock_valuation will be called on company 2, in the context, allowed_company_ids will be company 1. Then, when computing 'products', with_company() will add self (company 2) to the context. https://github.com/odoo/odoo/blob/616e82d7b3a53b1facf481e783baed3e99393d3c/addons/stock_account/models/res_company.py#L151-L152 So stock_value will return the sum of the total_value of each product for company 1 and company 2 which is 40 (instead of 10 for just company 2) https://github.com/odoo/odoo/blob/616e82d7b3a53b1facf481e783baed3e99393d3c/addons/stock_account/models/res_company.py#L242 We then create the closing accounting entry to match the accounting value with the stock value, which explains why the new initial accounting balance of company 2 is 40. **fix:** We set the context using self instead of self.env.companies This makes more sense as both in the cron use case and the generate entry use case the stock value we want is the one of the company in self. - In cron use case, it's obvious as the method is called in a for loop on each company - In the generate entry use case, self will also be the main company, because it's called, in actionGenerateEntry, on this.companyId https://github.com/odoo/odoo/blob/616e82d7b3a53b1facf481e783baed3e99393d3c/addons/stock_account/static/src/stock_valuation/controller.js#L75 which is computed based on the get_report_values https://github.com/odoo/odoo/blob/616e82d7b3a53b1facf481e783baed3e99393d3c/addons/stock_account/static/src/stock_valuation/controller.js#L21 https://github.com/odoo/odoo/blob/616e82d7b3a53b1facf481e783baed3e99393d3c/addons/stock_account/static/src/stock_valuation/controller.js#L28-L30 Which returns the main company https://github.com/odoo/odoo/blob/616e82d7b3a53b1facf481e783baed3e99393d3c/addons/stock_account/report/stock_valuation_report.py#L29 Most importantly, this is also aligned with how the accounting values are computed. https://github.com/odoo/odoo/blob/616e82d7b3a53b1facf481e783baed3e99393d3c/addons/stock_account/models/res_company.py#L103-L105 opw-6237402 closes #272792 X-original-commit: a2be945 Signed-off-by: Steve Van Essche <svs@odoo.com> Signed-off-by: Pierre-Louis Hance (plha) <plha@odoo.com>
Steps to reproduce: 1. Enable the language selector in the website header. 2. Enable the "Inline" and "Flag" options. 3. Inspect the flag images rendered in the inline variant. Issue: Flag images in the list items have an empty `alt=""` attribute in "Flag only" mode, where the flag is the sole visual indicator of the language, making the selector inaccessible to screen readers and providing no context for search crawlers. Expected behavior: Inline + Flag should have a descriptive ALT tag since there is no adjacent text or code to identify the language, the flag is not decorative. opw-6246464 closes #273426 X-original-commit: 5c340e2 Signed-off-by: Robin Lejeune (role) <role@odoo.com> Signed-off-by: Waleed Elgamal (waelg) <waelg@odoo.com>
Steps to reproduce: =================== 1. Add several delivery addresses & billing addresses 2. Add a product to the cart and go to checkout. 3. Select a specific delivery address and a different invoice address. 4. Pay and click "Skip" immediately on that page. 5. Open the resulting sales order. => The delivery address is reset to the company's first delivery child instead of the one selected during checkout. Root cause: =========== `partner_shipping_id` and `partner_invoice_id` are stored computed fields (compute + store + readonly=False) that depend on `partner_id`. Any write that includes `partner_id`, even writing the same value, retriggers the compute and overwrites a manually selected address with the result of `partner_id.address_get()`. `_get_and_cache_current_cart` resurrects the customer's draft cart when it is no longer referenced in the session and re-runs `_update_address(partner, ['partner_id'])` on it to refresh the pricelist and fiscal position. Clicking "Skip" runs `sale_reset()`, which clears the session cart key while the order is still draft, so the next cart access takes that abandoned-cart branch and the redundant `partner_id` write discards the selected delivery/invoice address. Waiting a few seconds lets the order reach the 'sale' state first, so the draft search no longer matches and the address is kept, which is why the issue is timing dependent. Fix: ==== In `_update_address`, when partner_id is written, keep the delivery and invoice addresses already set on the cart if they still belong to the new partner's company (same `commercial_partner_id`) by writing them in the same `write()` so the recompute does not override them. Addresses that do not belong to the new partner are still recomputed to the partner's defaults. opw-6267188 closes #273142 X-original-commit: c301742 Signed-off-by: Saif Allah Ben Khalil (sben) <sben@odoo.com>
The previous fix commits progress even when an unexpected exception escaped the loop iteration when _autopost_draft_entries. Now progress is only committed on success or when a UserError is explicitly handled. closes #273464 X-original-commit: 8f9a9f1 Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com> Signed-off-by: Nguyen Nguyen (ngtpn) <ngtpn@odoo.com>
When editing a POS config, `_ensure_public_attachments` wrote
`public=True` on the self-ordering background/home images on every
write. These images are Many2many attachments created with a `res_model`
but no `res_id`, so the attachment access check denies write to any
non-system user who is not their creator.
As a result, a POS manager without Settings/Admin rights could not edit
a config whose images were uploaded by another user (e.g. an admin
during setup), getting:
AccessError: Sorry, you are not allowed to access this document.
(Operation: write) - Records: ir.attachment(...), User: ...
Steps to reproduce:
1. Enable self-ordering on a POS and select a background image
2. Set self-ordering back to disabled
3. Log in as a POS admin without Admin/Settings rights
4. Try to edit the POS -> error
opw-6331261
closes #273537
X-original-commit: 9ec37b9
Signed-off-by: David Monnom (moda) <moda@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Steps to reproduce: - Set the header position to "Over the Content" - Set the background color to the last preset (dark) - Go to mobile view => If you are at the top of the page when opening the menu, the text is too dark to be readable. When the conversion from publicWidget to interaction was done, a mistake was made when converting HeaderGeneral. `o_top_menu_collapse_shown` was not toggled on `header#top` anymore. Therefore some css was not applied, leading to issues with the color constrasts. This commit fixes this issue by fixing the selector in dynamicContent. task-6311038 closes #273523 X-original-commit: c3df143 Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com> Signed-off-by: Romaric Moyeuvre (romo) <romo@odoo.com>
Since #256698, the `undeterministicTour_doNotCopy` flag was removed. Without this artificial delay, the `portal_load_homepage` tour executes steps faster than the website frontend JavaScript can finish initializing and binding event handlers to the form. Leaving the tour stuck on a blank text screen after Saving and causing a script timeout. Fix this by ensuring the frontend framework is fully initialized before interacting with the form fields. Runbot-242298 closes #273428 X-original-commit: 5e8ed5f Signed-off-by: Pierre Pulinckx (pipu) <pipu@odoo.com> Signed-off-by: Maxime Orban (orma) <orma@odoo.com>
**Steps to reproduce** - Install planning - Switch to English (UK) and change the "First day of the week" to Sunday in the technical settings - Have an employee with a flexible schedule with a total of 40h/week, average 8h/day - In the planning app, after creating a shift to display the employee in the gantt view, notice that when hovering over the progress bar on the left, 48 worked hours are expected for the current week, which is more than what is defined in the employee's calendar **Cause** The displayed week, starting on Sunday, could accumulate more hours than the weekly cap due to the Sunday being part of another week with the locale default first day (Monday). opw-6110395 closes #273332 X-original-commit: 6476aa2 Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
In this commit, we ensure that private tasks can never be selected as parent tasks unless they are templates. task-5119141 closes #270795 Signed-off-by: Maxime de Neuville (mane) <mane@odoo.com> (cherry picked from commit 1c60def) closes #271824 Signed-off-by: Maxime de Neuville (mane) <mane@odoo.com> Signed-off-by: Aurélien Bertrand (auber) <auber@odoo.com> (cherry picked from commit 39cce85) closes #273046 X-original-commit: 58a6ce1 Signed-off-by: Maxime de Neuville (mane) <mane@odoo.com> Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
When trying to import Product Categories, importing the Parent Category may raise blocking warnings. Steps to reproduce: - Open Sales > configuration > Categories - Import records - Select a file containing the parent category name - Import category name and parent category Issue: A warning will raise Found multiple matches for value "Furniture" in field "Parent Category" (2 matches) It occurs because, while searching by name, the system will use the complete name of the category so it will match multiple times the same name. This behaviour has been introduced in 0f788b8 opw-6283004 closes #273429 X-original-commit: 839f2aa Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com> Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
Steps to reproduce: =================== - Open any mail thread in chatter - Click the "Send To" button once - Click "Unfollow" - You will be a suggested recipient Cause of Issue: =============== The suggested recipient generation did not filter out the current user. When the user unfollows, `_message_get_suggested_recipients` is called when storing the thread, and since the user is no longer on the followers list, they get added back as a suggested recipient. https://github.com/odoo/odoo/blob/b4c7247ff218fb850fd91af3e2baa726a82d439c/addons/mail/models/models.py#L467-L468 Fix: ==== Since followers are excluded from suggested recipient candidates in the mail thread, and the current user should be excluded when they unfollow, the current user is excluded altogether. This means the current user will not be suggested as a recipient again unless they re-follow the record. opw-6122351 closes #273449 X-original-commit: 2d168ab Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Signed-off-by: Farah Ahmed (ahmfa) <ahmfa@odoo.com>
# Setup Ensure you currently have no activity # How to reproduce - Go to any form view with a chatter (e.g. Quotation form view) - Add 2 activities with a due date of today or before > Notice there activity counter next to the activity clock icon in the top right should be 2 - Click on the activity clock icon in the top right > Notifce the activity counter decreases to 1 - Mark as done both To-Do activites # The problem The activity counter is negative # Cause This issue is due to a desync between the activity counter client side and server side. When clicking on the activity clock icon, the front-end fetches the mail store data from the backend, which is why we see the activity counter decrease. The server computes the activity counter the following way : https://github.com/odoo/odoo/blob/86b2da224a5c543b279a188928bd47e4d59c2037/addons/mail/models/res_users.py#L457 It searches for up to 1000 activities and group them by the record they are associated to (e.g. a sale.order). Then, for each of these records, if atleast one activity is late or for today, increase the counter by 1 : https://github.com/odoo/odoo/blob/86b2da224a5c543b279a188928bd47e4d59c2037/addons/mail/models/res_users.py#L504-L509 Essentially, server side, we get a single +1 in the activity counter by record, not by activity On the other hand, client side, we simply add 1 in the activity counter every time a new activity is created. If an activity is deleted, then we remove 1 : https://github.com/odoo/odoo/blob/86b2da224a5c543b279a188928bd47e4d59c2037/addons/mail/static/src/core/web/mail_core_web_service.js#L17-L30 https://github.com/odoo/odoo/blob/86b2da224a5c543b279a188928bd47e4d59c2037/addons/mail/models/mail_activity.py#L305-L309 # Proposed solution Both the client and server side logic were edited fairly recently Server side : #234899 Client side : #215880 According to experts, the activity counter should count records, not activities, so we should fix the client side but properly doing would introduce too much complexity. We instead simply prevent the counter from going below 0. opw-6116821 closes #273495 X-original-commit: 2104ce0 Signed-off-by: Zachary Vanvlasselaer (zavan) <zavan@odoo.com>
Issue: ====== - In the latest Brave Browser version (1.90+), the first scan works properly, but the video preview disappears during the second scan. Fix: ==== - During the second scan, the video is unexpectedly paused. We now automatically play the video again if it is paused. task-6218047 closes #273415 X-original-commit: 81cfb00 Signed-off-by: David Monnom (moda) <moda@odoo.com> Signed-off-by: Vedant Pandey (vpan) <vpan@odoo.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bt_gitbot