Wednesday, September 4, 2024
5 changes · saas-17.4
Resolved issues and error corrections
CRM lead assignment now avoids loading unnecessary lead data and clears temporary data after each sales team is processed. This helps prevent memory errors during large assignment runs and keeps lead distribution more reliable for teams with many leads.
Original PR description
Issue ----- With the new assigntation system (see https://github.com/odoo/odoo/commit/f8d246ae1e794aa1d29319a783b9ed237b33c62d), the memory taken was exploding (more than 3Go in our use case). This…
Issue ----- With the new assigntation system (see https://github.com/odoo/odoo/commit/f8d246ae1e794aa1d29319a783b9ed237b33c62d), the memory taken was exploding (more than 3Go in our use case). This is due to _read_group that agregate the id by recordset. It fetch all the data at once even for a team that will assign no lead to any member (members_to_assign = False) (In our test example we add a team with 90k lead that could be assign but no member to receive any. The lead manager just forget to opt out the team) This is also due to convert to opportunity that was fetching many more information into the cache and the cache was never clear despite that each team works totally different recordset. As result the memory taken was getting bigger and bigger after each team was process and eventually endup with a memory error Solution -------- Don't agregate the ids with a recordset to avoid having len(self._prefetch_ids) reaching thousand of hundred of record Browse the lead for each team after being sure we need to assign them and finally invalidate the cache once a team is done we now, the request are not going to use those leads anymore. Misc Improvement ---------------- - Commit after each team to avoid concurrent update: We may want a big bundle size (100 or even more) to avoid too frequent commit inside a team but at the begining of each team the filter operation can takes times and we want to avoid having too long transaction if multiple team in a raw assign very few lead (for example if quota are already reached) - Allow sub module to customize the filter to fetch the lead to assign. ie: for some odoo implementation, lead with partner_assigned_id != False will never be assigned to a sales. we don't need to fetch them. It saves memory and time 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 update prevents Studio form edits from unintentionally saving records while users are editing views. It also allows approval rules to be added to more action buttons, helping businesses apply approval controls consistently.
This fixes an error that could interrupt product creation when scanning or entering a barcode for an item that has no image in the lookup service. Users can continue adding products from barcodes even when external image data is unavailable.
Original PR description
Currently, a traceback occurs when the user scans a product that has no image. To reproduce this issue: 1) Install stock, barcode lookup 2) Give an API key in settings for barcodelookup 3) Now create…
Currently, a traceback occurs when the user scans a product that has no image. To reproduce this issue: 1) Install stock, barcode lookup 2) Give an API key in settings for barcodelookup 3) Now create a new product variant by scanning the barcode of a product or enter the barcode manually in stock. Error:- ``` AttributeError: 'dict' object has no attribute 'content' ``` Note:- API key for testing:- `6ihv0vyhqbbsrda4f85lnlkxrmfjo8` Barcode for testing:- `7501030682332` Not every product may have an image, when there is no image it returns a dict having `status_code` and response_code. If it has an image it returns a response. https://github.com/odoo/enterprise/blob/8373c104d9edca368212dbb51df6d029a76d0750/product_barcodelookup/tools/barcode_lookup_service.py#L19-L26 But here only checked truth of `img_response` which always true and it leads to a traceback when `content` is extracted from the `img_response`. https://github.com/odoo/enterprise/blob/8373c104d9edca368212dbb51df6d029a76d0750/product_barcodelookup/models/product_template.py#L42-L48 Note:- Also here `product.image_1920` is checked twice (L42 & L45) and because of that, the `elif` condition will never be executed as the if condition will always be `true`. sentry-5790228190
The salary configurator now prevents employees from signing a contract when the proposed gross wage is below Belgium's minimum wage. This helps ensure contracts meet payroll compliance rules before they are finalized.
Original PR description
If the gross wage is below the minimum wage in the salary configurator, signature should be blocked. task-4155593
Fixes an error that could block users from sending and printing invoices in the Mexican localization when an invoice line has no product selected. This improves reliability for invoice processing in cases where users add description-only lines.
Original PR description
When ```display_name``` of product is False and user clicks on Send & Print button, A traceback will appear. Steps to reproduce the error: - Install ```l10n_mx_edi``` - Switch to the Mexican company…
When ```display_name``` of product is False and user clicks on Send & Print button,
A traceback will appear.
Steps to reproduce the error:
- Install ```l10n_mx_edi```
- Switch to the Mexican company
- Create an invoice > Click on Add a line > Click on add description and enter a description >
Don't add any product > Enter a price > Confirm
- Send & Print > Send & Print
Traceback:
```
TypeError: 'in <string>' requires string as left operand, not bool
File "odoo/http.py", line 2383, in __call__
response = request._serve_db()
File "odoo/http.py", line 1913, in _serve_db
return self._transactioning(
File "odoo/http.py", line 1976, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1943, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2187, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 227, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 757, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 40, in call_button
action = call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 459, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "addons/account/wizard/account_move_send.py", line 797, in action_send_and_print
return self._process_send_and_print(
File "addons/account/wizard/account_move_send.py", line 731, in _process_send_and_print
self._generate_invoice_documents(moves_data, allow_fallback_pdf=allow_fallback_pdf)
File "addons/account/wizard/account_move_send.py", line 627, in _generate_invoice_documents
self._call_web_service_before_invoice_pdf_render(invoices_data_web_service)
File "home/odoo/src/enterprise/saas-17.4/l10n_co_dian/wizard/account_move_send.py", line 73, in _call_web_service_before_invoice_pdf_render
super()._call_web_service_before_invoice_pdf_render(invoices_data)
File "home/odoo/src/enterprise/saas-17.4/l10n_br_edi/wizard/account_move_send.py", line 87, in _call_web_service_before_invoice_pdf_render
super()._call_web_service_before_invoice_pdf_render(invoices_data)
File "home/odoo/src/enterprise/saas-17.4/l10n_mx_edi/wizard/account_move_send.py", line 128, in _call_web_service_before_invoice_pdf_render
invoice._l10n_mx_edi_cfdi_invoice_try_send()
File "home/odoo/src/enterprise/saas-17.4/l10n_mx_edi/models/account_move.py", line 1756, in _l10n_mx_edi_cfdi_invoice_try_send
self.env['l10n_mx_edi.document']._send_api(
File "home/odoo/src/enterprise/saas-17.4/l10n_mx_edi/models/l10n_mx_edi_document.py", line 2022, in _send_api
populate_return = on_populate(cfdi_values)
File "home/odoo/src/enterprise/saas-17.4/l10n_mx_edi/models/account_move.py", line 1735, in on_populate
self._l10n_mx_edi_add_invoice_cfdi_values(cfdi_values)
File "home/odoo/src/enterprise/saas-17.4/l10n_mx_edi/models/account_move.py", line 973, in _l10n_mx_edi_add_invoice_cfdi_values
'name': invl._l10n_mx_edi_compute_line_name(),
File "home/odoo/src/enterprise/saas-17.4/l10n_mx_edi/models/account_move_line.py", line 9, in _l10n_mx_edi_compute_line_name
if self.product_id.display_name in self.name or self.name in self.product_id.display_name:
```
https://github.com/odoo/enterprise/blob/8373c104d9edca368212dbb51df6d029a76d0750/l10n_mx_edi/models/account_move_line.py#L9
Here, ```display_name``` will be False,
```in``` operator is not allowed between string and boolean.
So, It will lead to the above traceback.
sentry-5789031637