Daily updates from Odoo
Friday, November 8, 2024
2 changes
1 change
Enhancements to existing features
User lookup by display name has been adjusted to avoid a slow database search pattern on very large user lists. This restores the previous behavior and can reduce searches from many seconds to milliseconds, improving responsiveness in user-related screens and operations.
Original PR description
After removal of _name_search(), the res.users `_search_display_name()` has been rewritten to use an `OR` to match either exactly the login or part of the name; this make the query very inefficient as it prevent PostgreSQL to use the index an any of the two fields.
This commit re-introduce the previous behavior: we first check for an exact users match on the login or (if none) we fallback to standard display name search (for `name`).
With a database will multiple millions of users:
Before:
```
In [1]: %time env["res.users"].search([('display_name', 'ilike', 'OdooBot')])
CPU times: user 2.03 ms, sys: 8 µs, total: 2.04 ms
Wall time: 16.8 s
```
After:
```
In [1]: %time env["res.users"].search([('display_name', 'ilike', 'OdooBot')])
CPU times: user 1.21 ms, sys: 1.87 ms, total: 3.08 ms
Wall time: 6.69 ms
```
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr1 change
Enhancements to existing features
This update enables the invoicing of free items in Peru, aligning with local regulations. It modifies the invoice XML structure to exclude dummy tax groups, ensuring compliance with SUNAT requirements. This simplifies the invoicing process for Peruvian businesses.
Original PR description
We need to be able to invoice free items. How it works in Peru is that the item is "sold" with the original price. Still, we should be able to mark the transaction as a free transaction (this is done…
We need to be able to invoice free items. How it works in Peru is that the item is "sold" with the original price. Still, we should be able to mark the transaction as a free transaction (this is done with the field l10n_pe_edi_legend that is in the Peru EDI tab). This tag should change the XML to the correct format for a free transaction. An enhancement is introduced to exclude the 'l10n_pe.tax_group_dummy' tax group from tax details processing. This improvement is aimed at facilitating free billing in Peru by ensuring dummy tax groups are not included in tax calculations. task latam: https://latam-localizations.odoo.com/web#id=974&menu_id=88&cids=1&action=188&model=project.task&view_type=form Legal Reference: https://cpe.sunat.gob.pe/sites/default/files/inline-files/guia%2Bxml%2Bfactura%2Bversion%202-1%2B1%2B0%20%282%29_0.pdf (page 97) https://booksdigital.jimdofree.com/2014/10/15/tratamiento-contable-de-la-entrega-de-obsequios-vales-y-celebraciones-a-favor-de-los-trabajadores/ Related: https://github.com/odoo/odoo/pull/174131