Daily updates from Odoo
Navigate
Branch
Saturday, July 13, 2024
6 changes
4 changes
Miscellaneous changes
### [FIX] core: fix _RelationalMulti.convert_to_cache() Since e0297bdac4eac165a79680de3b1139c2f554d5f5, we have tried to manage sibling dependencies in onchange, but we still have a bug: We already have a record N with a record R1 inside its one2many, when we create a new line R2, during the first onchange() on the one2many comodel, the cache of the N.one2many correctly contains R1 and the current new record R2. But at the onchange on a second line R3, N.one2many will only contain R2 + R3 and
Original PR description
### [FIX] core: fix _RelationalMulti.convert_to_cache() Since e0297bdac4eac165a79680de3b1139c2f554d5f5, we have tried to manage sibling dependencies in onchange, but we still have a bug: We already…
### [FIX] core: fix _RelationalMulti.convert_to_cache() Since e0297bdac4eac165a79680de3b1139c2f554d5f5, we have tried to manage sibling dependencies in onchange, but we still have a bug: We already have a record N with a record R1 inside its one2many, when we create a new line R2, during the first onchange() on the one2many comodel, the cache of the N.one2many correctly contains R1 and the current new record R2. But at the onchange on a second line R3, N.one2many will only contain R2 + R3 and R1 won't be in it. This happens because of the _RelationalMulti.convert_to_cache() uses the 'validate' attribute as a way to know if we need to avoid using the default value for new record without origin (see test_40_new_defaults). Example of the stack: From onchange: `record._update_cache(changed_values)` From _update_to_cache, validate=True, field=Many2one, value=dict: `value = field.convert_to_cache(value, self, v alidate)` From convert_to_cache: `id_ = comodel.new(value, origin=origin).id` From new: `record._update_cache(values, validate=False)` From _update_to_cache, validate=False, field=move_line_ids, value=commands: `value = field.convert_to_cache(value, self, validate)` From convert_to_cache: `ids = OrderedSet(record[self.name]._ids if validate else ())` Instead check if it is a new record without origin to know if we need to bypass the default value or take the real/origin values from the cache and apply the commands to it. ### [FIX] base_automation: fix usage of convert_to_cache() In the previous commit, we changed the behavior of convert_to_cache() for X2many fields when validate=False. The base_automation was relying on this to compare old and new values of X2many because the old values were in read format and the new values were in record format. Instead of relying on read(), use the record format for old values and compare the record values. There are some minor changes: - We now fetch less data because the read() fetch display_name of many2one and if vals is empty will actually fetch all fields for no reason. - The order of X2many generated by command values doesn't matter anymore, but it shouldn't anyway, because we only want to trigger the base automation when the set of records changes. (Add a test ?) ### [FIX] tests: better simulate M2M in server side Form Since e4b66668e0ff3d5444ef7fc7b79e6226c513e2c0, the webclient sends LINK and UNLINK commands for many2many values, but the Form test class only used SET commands. Try to mimic the web client more closely. Forward-Port-Of: odoo/odoo#168735
Steps to reproduce ================== Example A) - Install project - In the settings, enable subtasks - Open any project - Open any task - Switch to the "Sub-Tasks" notebook tab - Add a new line with a very long name - Save => The list overflows to the right and does not allow to scroll Example B) - Install Expenses - Go to Expense Report - Open any record - Enable every optional column - Reduce the window width => Same issue Cause of the issue ==================
Original PR description
Steps to reproduce ================== Example A) - Install project - In the settings, enable subtasks - Open any project - Open any task - Switch to the "Sub-Tasks" notebook tab - Add a new line with…
Steps to reproduce ================== Example A) - Install project - In the settings, enable subtasks - Open any project - Open any task - Switch to the "Sub-Tasks" notebook tab - Add a new line with a very long name - Save => The list overflows to the right and does not allow to scroll Example B) - Install Expenses - Go to Expense Report - Open any record - Enable every optional column - Reduce the window width => Same issue Cause of the issue ================== Without a custom widget, the classes on a one2many field are `o_field_widget `o_field_one2many`. With a custom widget, the classes are for example `o_field_widget o_field_subtasks_one2many`. This means that this [css] snippet is not applied. An attempt has been made to pass those classes in [additionalClasses], but it's missing in the examples used to reproduce this issue. In the example B, the list is wider than the allowed space, because the minimum width for a column is [92px] and if we sum them all, it is more than the total space. Those issues have become more apparent since a [fix] for Safari. The allowed width was computed with a fixed table layout, which means in most cases, it was a bit less. We can see though that even before the [fix] for Safari, there were still issues, for example in the example B. Solution ======== We add back the css removed from the [additionalClasses] fix. It was removed initially since `:has` was not supported in Firefox. It is now supported since 2023-12-19. Still, if someone has an old version, it will not fix the issue. For that, we still add the classes to the two reported widgets. --- [css]: https://github.com/odoo/odoo/blob/6abd479dcae0e206155d8d7171b62e384fa61740/addons/web/static/src/views/form/form_controller.scss#L710-L718 [additionalClasses]: https://github.com/odoo/odoo/pull/121182 [92px]: https://github.com/odoo/odoo/blob/ae5de53c3f4009d23ec556be4abb9eefd111f9b7/addons/web/static/src/views/list/list_renderer.js#L395 [fix]: https://github.com/odoo/odoo/commit/ae5de53c3f4009d23ec556be4abb9eefd111f9b7 opw-4010760 opw-4028675 Forward-Port-Of: odoo/odoo#172926
The commit adds indexing to frequently accessed fields as records tend to be lare which causes long waiting loading. fetching and counting benchmarks: ~11M reords were created: - 4k with campaign_id = 4 - 11M with campaign_id = 5 before indexing: - 1889.532 ms after indexing: - 10.617 ms task-3980514 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
Original PR description
The commit adds indexing to frequently accessed fields as records tend to be lare which causes long waiting loading. fetching and counting benchmarks: ~11M reords were created: - 4k with campaign_id = 4 - 11M with campaign_id = 5 before indexing: - 1889.532 ms after indexing: - 10.617 ms task-3980514 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#172657
Steps to reproduce ================== - Install sale_management - Create a new Quotation * select a partner * quotation date: exactly one year ago * add a line with a product * save but don't confirm - Go to Sales > Reporting - Remove any filter - Filter by order date: the current month - Add a comparison: "Order date: Previous Year" => The dataset are stacked Let's say with have the following values: July 2024: 10k July 2023: 5k The July 2023 point will be disp
Original PR description
Steps to reproduce ================== - Install sale_management - Create a new Quotation * select a partner * quotation date: exactly one year ago * add a line with a product * save but don't confirm - Go to Sales > Reporting - Remove any filter - Filter by order date: the current month - Add a comparison: "Order date: Previous Year" => The dataset are stacked Let's say with have the following values: July 2024: 10k July 2023: 5k The July 2023 point will be displayed with an Y coordinate being the sum of both: 15k. It doesn't make sense as we wan't to be able to compare both values visually Solution ======== Always disable the stacked mode when using a comparison opw-3960098 Forward-Port-Of: odoo/odoo#172906 Forward-Port-Of: odoo/odoo#171800
1 change
Miscellaneous changes
The commits https://github.com/odoo/odoo/commit/f1749d3299957e2949e0b78653266a5397bb213c and https://github.com/odoo/odoo/commit/847e5c984a6873954686503886e1874b78c75951 have introduced some bugs detected by the test clickall. We fix those bugs here. Runbot build: https://runbot.odoo.com/runbot/build/65237075 Forward-Port-Of: odoo/enterprise#66481
Original PR description
The commits https://github.com/odoo/odoo/commit/f1749d3299957e2949e0b78653266a5397bb213c and https://github.com/odoo/odoo/commit/847e5c984a6873954686503886e1874b78c75951 have introduced some bugs detected by the test clickall. We fix those bugs here. Runbot build: https://runbot.odoo.com/runbot/build/65237075 Forward-Port-Of: odoo/enterprise#66481
1 change
New functionality added to Odoo
This update adds support for version 3.1 of Mexico's Carta Porte (Delivery Guide) standard. The system now handles multiple customs regimes per shipment instead of just one, improving flexibility for complex shipping scenarios. Existing data is automatically migrated to the new format.
Original PR description
This will add support for the new version 3.1 of the Mexian Carta Porte (Delivery Guide). The main change is that the Many2one `l10n_mx_edi_customs_regime_id` field on `stock.picking` becomes a Many2many. The existing ids are transferred to the new join table in a `_post_init_hook()`. task-4000227 Forward-Port-Of: odoo/enterprise#66574 Forward-Port-Of: odoo/enterprise#66040