Daily updates from Odoo
Friday, July 19, 2024
21 changes · master
Enhancements to existing features
This update simplifies how the Knowledge app prepares a user-facing message by removing an unnecessary intermediate step. It does not change functionality, but helps keep the code easier to maintain and less prone to future issues.
Original PR description
Also inline the local as there doesn't seem to be a point to it.
Appointment invite codes now avoid exposing raw technical identifiers and are generated only when needed. This keeps invite references cleaner for users while slightly reducing unnecessary processing behind the scenes.
Original PR description
Also don't compute an entire uuid4 for just 4 random bytes, and don't compute anything if we don't need to
The Helpdesk ticket form now shows helpful placeholder text in the description field. This gives users clearer guidance on what information to enter, making ticket creation easier and more consistent.
Original PR description
Prior to the this commit, the description of a ticket was empty in the helpdesk's ticket view form. This PR adds a placeholder to the description in order to help users understand better its usage. Task-3858665
Timesheet-related screens now show the correct label for the unit amount field directly in each view. This removes an older workaround and makes the wording more consistent for users across helpdesk, sales timesheets, and timesheet grid screens.
Original PR description
With task 3330297, the override made to set the right label to unit_amount field is no longer needed. This PR will remove the override and set the correct label for this field in every view. task-3911485
This update improves how Knowledge article names are prepared by ensuring all relevant information is tracked upfront. It helps avoid unnecessary background lookups, which can make related Knowledge views load more efficiently.
Original PR description
Some fields are missing in the display_name dependencies resulting in additional queries.
Field service tasks will no longer create a blank timesheet sales line when products are added but no time is recorded before the task is completed. This keeps sales orders cleaner and avoids confusing or unnecessary billing lines.
Original PR description
With this commit, we prevent the creation of an empty sol for timesheets when products are added to the task but no timesheet entries are made. and, the task is marked as done. task-3995703
Resolved issues and error corrections
This update corrects internal code imports used by accounting reports and removes an unused reference. It helps keep the reporting module compatible and easier to maintain without changing day-to-day user workflows.
Original PR description
- `parse_version` should never have been imported from `odoo.tools.misc` because it was never intentionally exported from there (misc just used it internally, and has not done that since 2021) - remove unused `_lt` import - fix imports organisation
Code cleanup and technical improvements
The Mexican electronic delivery guide functionality has been reorganized by merging the version-specific extension back into its parent module. This keeps the same business capabilities while simplifying maintenance and reducing module complexity for future updates.
Original PR description
`l10n_mx_edi_stock_extended_31` was added in version `15.0` as a dedicated module for the stable versions. This PR merges it back into its parent module. task-4000227
Miscellaneous changes
The trust widget was missing a prop causing a client stacktrace when in debug mode. It appears in saas-17.2 due to https://github.com/odoo/enterprise/commit/47434fba1acd9b7bcc0a4eb74f6b2dc4454f0068 opw-4058127 Forward-Port-Of: odoo/enterprise#66891
Original PR description
The trust widget was missing a prop causing a client stacktrace when in debug mode. It appears in saas-17.2 due to https://github.com/odoo/enterprise/commit/47434fba1acd9b7bcc0a4eb74f6b2dc4454f0068 opw-4058127 Forward-Port-Of: odoo/enterprise#66891
This commit changes the user for the test `:TestWKnowledgeSecurity.test_models_as_user` which should test ACLs for internal users. Initially it used `portal_user`, which is not internal but portal. It is now replaced by `employee`. task-4059967 Forward-Port-Of: odoo/enterprise#66948 Forward-Port-Of: odoo/enterprise#66869
Original PR description
This commit changes the user for the test `:TestWKnowledgeSecurity.test_models_as_user` which should test ACLs for internal users. Initially it used `portal_user`, which is not internal but portal. It is now replaced by `employee`. task-4059967 Forward-Port-Of: odoo/enterprise#66948 Forward-Port-Of: odoo/enterprise#66869
We send the name of an old blackbox Now we send a generic name for blackbox device "blackbox" Forward-Port-Of: odoo/enterprise#66920
Original PR description
We send the name of an old blackbox Now we send a generic name for blackbox device "blackbox" Forward-Port-Of: odoo/enterprise#66920
The accounting date is used as acquisition date instead of bill date. Steps: 2 flows leads to the bug: 1) - Create and confirm a bill with different accoutning and bill dates - Open a new asset form and click on "select related purchases" button - Select the bill -> The acquisition is set as the accounting date instead of the bill date 2) - Set the expense account to create an asset - Create and confirm a bill with line using the expense account - An asset should be
Original PR description
The accounting date is used as acquisition date instead of
bill date.
Steps:
2 flows leads to the bug:
1) - Create and confirm a bill with different accoutning and bill dates
- Open a new asset form and click on "select related purchases"
button
- Select the bill
-> The acquisition is set as the accounting date instead of the bill
date
2) - Set the expense account to create an asset
- Create and confirm a bill with line using the expense account
- An asset should be created, open it
-> Same as before
Cause:
In the `_compute_acquisition_date`, we use the field `date` from
`account.move.line` which is a related field to the `date` field of
`account_move`
Fix:
In the compute, we get the `invoice_date` field from the related move
of each `original_move_line_ids` then fallback to `date` if it is not
set (case of journal entries)
opw-4000259
Forward-Port-Of: odoo/enterprise#66921
Forward-Port-Of: odoo/enterprise#65769churned Before this commit, if a renewal was churned then canceled, the parent order was not reopened. taskid: 4024437 Forward-Port-Of: odoo/enterprise#66862 Forward-Port-Of: odoo/enterprise#65826
Original PR description
churned Before this commit, if a renewal was churned then canceled, the parent order was not reopened. taskid: 4024437 Forward-Port-Of: odoo/enterprise#66862 Forward-Port-Of: odoo/enterprise#65826
When you select a city from the city list (city_id field) on the res.partner the cities are filtered by country in standard. However this is complicated to use because more often than not there are many cities with the same name. This is specially frequent in large countries. So simply changing it to domain="[('state_id', '=', state_id)]" solves the issue. task: 4027290 Forward-Port-Of: odoo/enterprise#66582 Forward-Port-Of: odoo/enterprise#66495
Original PR description
When you select a city from the city list (city_id field) on the res.partner the cities are filtered by country in standard. However this is complicated to use because more often than not there are many cities with the same name. This is specially frequent in large countries.
So simply changing it to domain="[('state_id', '=', state_id)]" solves the issue.
task: 4027290
Forward-Port-Of: odoo/enterprise#66582
Forward-Port-Of: odoo/enterprise#66495We get a singleton error in multicompany setup when opening the accounting dashboard Steps: - Have at least two companies, one with l10n_fr_reports installed - Select the two companies in the caompany selector - Go to accounting dashboard -> singleton error opw-4053554 Forward-Port-Of: odoo/enterprise#66866 Forward-Port-Of: odoo/enterprise#66757
Original PR description
We get a singleton error in multicompany setup when opening the accounting dashboard Steps: - Have at least two companies, one with l10n_fr_reports installed - Select the two companies in the caompany selector - Go to accounting dashboard -> singleton error opw-4053554 Forward-Port-Of: odoo/enterprise#66866 Forward-Port-Of: odoo/enterprise#66757
**Current behavior before PR:** In mobile view, whatsapp tab had no search button. **Desired behavior after PR is merged:** In mobile view, added a search button to find whatsapp channel. task-id:3525542 Forward-Port-Of: odoo/enterprise#66861 Forward-Port-Of: odoo/enterprise#59530
Original PR description
**Current behavior before PR:** In mobile view, whatsapp tab had no search button. **Desired behavior after PR is merged:** In mobile view, added a search button to find whatsapp channel. task-id:3525542 Forward-Port-Of: odoo/enterprise#66861 Forward-Port-Of: odoo/enterprise#59530
In [1], a limit was introduced to the amount of records that can be displayed at the same time in the shop floor app. However, it was not always very clear to the user that they may only be viewing a subset of the available records. It was also impossible to show any records beyond the first 40 that conform to the filter criteria. In this commit, we introduce a pager to resolve these issues. The pager will only be displayed when relevant (ie when not all available records are displayed). Usin
Original PR description
In [1], a limit was introduced to the amount of records that can be displayed at the same time in the shop floor app. However, it was not always very clear to the user that they may only be viewing a subset of the available records. It was also impossible to show any records beyond the first 40 that conform to the filter criteria. In this commit, we introduce a pager to resolve these issues. The pager will only be displayed when relevant (ie when not all available records are displayed). Using this new pager it is also possible for the user to dynamically increase or decrease the default limit of 40, which was not possible before. [1] https://github.com/odoo/enterprise/pull/64551 (and forward ports) Forward-Port-Of: odoo/enterprise#66848 Forward-Port-Of: odoo/enterprise#65995
Before this commit, when clicking on the action with the hierarchy enabled, the parent line were not unfolded which cause the purpose of the action to be useless. task-3839845 Forward-Port-Of: odoo/enterprise#66531 Forward-Port-Of: odoo/enterprise#63965
Original PR description
Before this commit, when clicking on the action with the hierarchy enabled, the parent line were not unfolded which cause the purpose of the action to be useless. task-3839845 Forward-Port-Of: odoo/enterprise#66531 Forward-Port-Of: odoo/enterprise#63965
Steps to reproduce: - Install "Field Service" - Open a random task - Click on "Navigate To" Issues: The link is constructed using the coordinates, however Google will convert those coordinates back to an address which will cause a potential discrepancy between the two. opw-4004846 Forward-Port-Of: odoo/enterprise#66691 Forward-Port-Of: odoo/enterprise#65893
Original PR description
Steps to reproduce: - Install "Field Service" - Open a random task - Click on "Navigate To" Issues: The link is constructed using the coordinates, however Google will convert those coordinates back to an address which will cause a potential discrepancy between the two. opw-4004846 Forward-Port-Of: odoo/enterprise#66691 Forward-Port-Of: odoo/enterprise#65893
Fixes a commit e3d7b06 Should look at the `self.order_id` creator instead of `self`. opw-3933511 Forward-Port-Of: odoo/enterprise#66791 Forward-Port-Of: odoo/enterprise#66748
Original PR description
Fixes a commit e3d7b06 Should look at the `self.order_id` creator instead of `self`. opw-3933511 Forward-Port-Of: odoo/enterprise#66791 Forward-Port-Of: odoo/enterprise#66748
When a user tries to validate an invoice of the refunded order a traceback will occur. Steps to produce: - Install 'l10n_mx_edi_pos' module. - Switch to a company whose country code is 'MX'(Mexico). - Open 'Point of Sale' and New Session. - Select any products > payment > Select payment method > Invoice > Select customer > Validate. - Click on 'Next Order'. - Click on 'Refund and select your order. - Click on refund > payment > Select payment method > Invoice > Validate. - Error wil
Original PR description
When a user tries to validate an invoice of the refunded order a traceback will occur. Steps to produce: - Install 'l10n_mx_edi_pos' module. - Switch to a company whose country code is 'MX'(Mexico).…
When a user tries to validate an invoice of the refunded order a traceback will occur.
Steps to produce:
- Install 'l10n_mx_edi_pos' module.
- Switch to a company whose country code is 'MX'(Mexico).
- Open 'Point of Sale' and New Session.
- Select any products > payment > Select payment method > Invoice > Select customer > Validate.
- Click on 'Next Order'.
- Click on 'Refund and select your order.
- Click on refund > payment > Select payment method > Invoice > Validate.
- Error will be generated.
Traceback on sentry:
```
TypeError: can only concatenate str (not "bool") to str
File "odoo/http.py", line 2252, in __call__
response = request._serve_db()
File "odoo/http.py", line 1828, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1848, 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 1826, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1833, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2058, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 222, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 740, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 42, in call_button
action = self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 34, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 458, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "home/odoo/src/enterprise/saas-17.1/l10n_mx_edi_pos/models/pos_order.py", line 108, in action_pos_order_invoice
action_values = super().action_pos_order_invoice()
File "addons/point_of_sale/models/pos_order.py", line 856, in action_pos_order_invoice
res = self._generate_pos_order_invoice()
File "addons/point_of_sale/models/pos_order.py", line 873, in _generate_pos_order_invoice
move_vals = order._prepare_invoice_vals()
File "addons/pos_sale/models/pos_order.py", line 32, in _prepare_invoice_vals
invoice_vals = super(PosOrder, self)._prepare_invoice_vals()
File "home/odoo/src/enterprise/saas-17.1/l10n_mx_edi_pos/models/pos_order.py", line 150, in _prepare_invoice_vals
vals['l10n_mx_edi_cfdi_origin'] = '03|' + self.refunded_order_id.account_move.l10n_mx_edi_cfdi_uuid
```
This is because 'l10n_mx_edi_cfdi_uuid' is empty at [1] and a string concatenate with it.
link [1]: https://github.com/odoo/enterprise/blob/1502f8b3e519d41f4a58e2acc846f315f6f5eeda/l10n_mx_edi_pos/models/pos_order.py#L150
This commit solves the above issue while checking the existence of
'l10n_mx_edi_cfdi_uuid' while creating the invoice for refund_order
sentry-4935781389
Forward-Port-Of: odoo/enterprise#64038
Forward-Port-Of: odoo/enterprise#59873