Daily updates from Odoo
Monday, July 1, 2019
4 changes
Enhancements to existing features
When selecting website views, duplicated views now include the related website name so users can tell them apart. This reduces confusion for teams managing multiple websites in the same Odoo database.
Original PR description
Before this commit, it was impossible to know which view was the one searched if there was COW views. Indeed, since multiwebsite, views might get duplicated from one website to another. Then, when searching for an ir.ui.view in a form view, every duplicated view would be listed next to each other with the exact same name without a way to identify which one comes from which website. This commit will suffix the view name by its website_id if there is one. To do so, we use the context key that has been introduced with 62d73253f3. task-1920052
Module uninstall now removes related data in safe batches instead of one record at a time. This can dramatically reduce uninstall times for data-heavy modules while preserving safeguards that skip records which cannot be removed.
Original PR description
Before this commit, during a module uninstall, module data would be unlinked on a record-by-record basis, this was done this way for two elementary reasons: - To guarantee an unlink order, as some…
Before this commit, during a module uninstall, module data would be
unlinked on a record-by-record basis, this was done this way for two
elementary reasons:
- To guarantee an unlink order, as some module data being deleted
might only be deleted if some other module data has already been
deleted.
e.g. [a, b, c, a] -> we could batch unlink both `a` in the
list, however the second `a` could depend on the unlink
of either b or c, making the groupby erroneous.
- To create a savepoint before every module data unlink (record), so
that in case it fails, we can simply skip it and proceed with the
uninstall.
After this commit, batch unlink of module data is now possible without
losing the aforementioned key features.
- The first problem is fixed by using `itertools.groupby`, which
will group **adjacent** data of the same type and unlinks them all
in batch while guaranteeing correct unlink order.
e.g. [a, a, a, b, b, c, a, c, c, c] -> this will unlink in
batches of [a, a, a], [b, b], [c], [a], [c, c, c]
- The second problem is fixed by making a savepoint per batch, if
a single element of the batch fails and the recordset contains more
than one element, we split the recordset into two and we repeat the
unlink process recursively until we weed out the undeletable record
Real world example: **l10n_mx_edi** takes **20min** to uninstall because it
contains a lot of master data (~55k records), with this patch the
uninstall takes a measly **20s**.
It should generally reduce the uninstallation time for all modules, but
those with lots of master data will see greater benefits in terms of
time.
opw-2025895
cc @Julien00859Point of Sale order lines can now show the unit of measure used for each product when the related option is enabled. This helps staff and managers better understand quantities sold, especially for products sold in different units.
Original PR description
Description of the issue/feature this PR addresses: Display the UOM in the pos order line Task id: 2001995 Current behavior before PR: We don't see the UOM of any product Desired behavior after PR is merged: If the option is selected, we can see the UOM of any product in the pos order line. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Product managers can now reorder extra product images and media using drag and drop instead of manually changing sequence numbers. This makes maintaining product pages faster and less error-prone, especially for items with multiple media assets.
Original PR description
This makes the media easier to sort than manually manipulating their sequence. task-2029597