Wednesday, August 28, 2024
5 changes · saas-17.2
Resolved issues and error corrections
Project setup checks now ensure milestones are enabled before running guided tours. This prevents tour failures in databases without demo data and makes project-related testing more reliable.
Original PR description
Some project tours rely on the milestones feature being enabled. While this is the case when demo data are installed, it's not when they aren't, and the tours fail. To solve this issue, and prevent future ones from being created, PR enables the feature before each tour. Task-4132639
Miscellaneous changes
Enterprise PR: https://github.com/odoo/enterprise/pull/68087 A user without any accounting access right set get an error when creating an invoice from a sale order. The user should be able to see the draft invoice when clicking on the 'Create Invoice' from a sale order, as it is the case without the l10n_cl_edi module. ### Steps to reproduce: - Install the 'l10n_cl_edi' module - As admin go to Settings > Manage Users, click on a User and, in Access Rights, change Accounting > Invoicing t
Original PR description
Enterprise PR: https://github.com/odoo/enterprise/pull/68087 A user without any accounting access right set get an error when creating an invoice from a sale order. The user should be able to see the…
Enterprise PR: https://github.com/odoo/enterprise/pull/68087 A user without any accounting access right set get an error when creating an invoice from a sale order. The user should be able to see the draft invoice when clicking on the 'Create Invoice' from a sale order, as it is the case without the l10n_cl_edi module. ### Steps to reproduce: - Install the 'l10n_cl_edi' module - As admin go to Settings > Manage Users, click on a User and, in Access Rights, change Accounting > Invoicing to nothing - (Make sure the User Type is Internal User) - Switch to this user - Go to Sales and create a new Quotation, confirm - Click on the 'Create Invoice' button - An access error appears because of 'l10n_cl.account.invoice.reference' ### Cause: The records of `l10n_cl.account.invoice.reference` are only readable by Accounting groups. ### Solution: Make the records of `l10n_cl.account.invoice.reference` accessible to all internal users. This will raise another access error for `l10n_latam.document.type`, so we also need to make them accessible (in community). ### Note: I noticed the access right of `l10n_cl.account.invoice.reference` were giving rights to `account.group_account_invoice` twice, where I think the second time was supposed to be `account.group_account_manager`. I don't know if this is wanted, but it doesn't make sense to have two lines for the same model and user group. I decided to only change `group_account_invoice` to `group_account_manager` so this PR is removing the write, create, unlink rights of `account.group_account_invoice`. opw-4078302 Forward-Port-Of: odoo/odoo#175988
Versions -------- - 17.0+ Steps ----- 1. Have industry_fsm_sale from enterprise installed; 2. create a SO using a different `partner_id` for the shipping address; 3. add a product that uses timesheets without creating a task; 3. confirm the sale order; 4. in Field Service, create a new task; 5. set Customer to `partner_id` used for shipping address; 6. select the relevant Sales Order Item; 7. add a product in catalog. Issue ----- After adding a product to the field service tas
Original PR description
Versions -------- - 17.0+ Steps ----- 1. Have industry_fsm_sale from enterprise installed; 2. create a SO using a different `partner_id` for the shipping address; 3. add a product that uses…
Versions -------- - 17.0+ Steps ----- 1. Have industry_fsm_sale from enterprise installed; 2. create a SO using a different `partner_id` for the shipping address; 3. add a product that uses timesheets without creating a task; 3. confirm the sale order; 4. in Field Service, create a new task; 5. set Customer to `partner_id` used for shipping address; 6. select the relevant Sales Order Item; 7. add a product in catalog. Issue ----- After adding a product to the field service task, a new SO is created instead of adding it to the existing SO (as would be the case if the task was created by the SOL). Cause ----- When computing a task's `sale_order_id`, it checks whether the task's `partner_id` matches that of the sale order. FSM tasks generally use the `partner_shipping_id` instead, so if this one is different, `sale_order_id` is set to `False`. Solution -------- Aside from sale order's `partner_id`, also check its `partner_invoice_id` and `partner_shipping_id` when deciding whether the task should get linked to the SO. Also changes one of the dependent fields of the compute method from `project_id` to `project_id.sale_order_id`, assuming that when a task's `sale_order_id` is derived from its project's, changing the project's SO should trigger a recompute for the task's as well. opw-3901885 Forward-Port-Of: odoo/odoo#177509 Forward-Port-Of: odoo/odoo#175658
Currently, a traceback occurs when the user `posts journal entries` with `multiple expenses` in which one of the expense doesn't have a `date`. To reproduce this issue: 1) Install `Expense` 2) Create an expense report(expense sheet) with multiple expense lines 3) Remove one of the expense's date 4) Click Submit to Manager> Approve> Post Journal Entries Error: ``` TypeError: '>' not supported between instances of 'datetime.date' and 'bool' File "odoo/http.py", line 2248, in __
Original PR description
Currently, a traceback occurs when the user `posts journal entries` with `multiple expenses` in which one of the expense doesn't have a `date`. To reproduce this issue: 1) Install `Expense` 2) Create…
Currently, a traceback occurs when the user `posts journal entries` with `multiple expenses`
in which one of the expense doesn't have a `date`.
To reproduce this issue:
1) Install `Expense`
2) Create an expense report(expense sheet) with multiple expense lines
3) Remove one of the expense's date
4) Click Submit to Manager> Approve> Post Journal Entries
Error:
```
TypeError: '>' not supported between instances of 'datetime.date' and 'bool'
File "odoo/http.py", line 2248, in __call__
response = request._serve_db()
File "odoo/http.py", line 1823, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1843, 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 1821, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1828, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2053, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 220, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 756, 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.2/hr_expense_extract/models/hr_expense.py", line 199, in action_sheet_move_create
return super().action_sheet_move_create()
File "addons/hr_expense/models/hr_expense_sheet.py", line 558, in action_sheet_move_create
self._do_create_moves()
File "addons/sale_expense/models/hr_expense_sheet.py", line 119, in _do_create_moves
return super()._do_create_moves()
File "addons/hr_expense/models/hr_expense_sheet.py", line 700, in _do_create_moves
moves = self.env['account.move'].create([sheet._prepare_bills_vals() for sheet in own_account_sheets])
File "addons/hr_expense/models/hr_expense_sheet.py", line 700, in <listcomp>
moves = self.env['account.move'].create([sheet._prepare_bills_vals() for sheet in own_account_sheets])
File "addons/hr_expense/models/hr_expense_sheet.py", line 728, in _prepare_bills_vals
**self._prepare_move_vals(),
File "addons/hr_expense/models/hr_expense_sheet.py", line 749, in _prepare_move_vals
'date': self.accounting_date or max(self.expense_line_ids.mapped('date')) or fields.Date.context_today(self),
```
When the user clicks on the `Post Journal Entries` Button, it tries to create an expense report in which `_prepare_move_vals` method triggers.
In this method, the `max` function is used to get the date from `expense_line_ids`.
If any one of the expense lines doesn't have a date(date is not required) it leads to a traceback.
https://github.com/odoo/odoo/blob/607e454f65c2c60c4ee5169bc53706f24a8bc625/addons/hr_expense/models/hr_expense_sheet.py#L725-L732
After applying this commit, it will resolve this issue by filtering records with date and then the max function is used to get the maximum date.
sentry-5616738740
Forward-Port-Of: odoo/odoo#173613Issue: Signature command doesn't work in 16.0 and raises an error in 17.0+ Steps to reproduce the issue: - install website - add forum in the website - create a new post in the forum - add signature - (nothing happens in 16.0, error in 17.0) Origin of the issue: ==================== The session in the forum post view doesn't have `uid`. Solution: ======== Use `session.user_id` instead of `session.uid` which works in forum as well as in other apps. opw-4066436 Forward-Port-
Original PR description
Issue: Signature command doesn't work in 16.0 and raises an error in 17.0+ Steps to reproduce the issue: - install website - add forum in the website - create a new post in the forum - add signature - (nothing happens in 16.0, error in 17.0) Origin of the issue: ==================== The session in the forum post view doesn't have `uid`. Solution: ======== Use `session.user_id` instead of `session.uid` which works in forum as well as in other apps. opw-4066436 Forward-Port-Of: odoo/odoo#177414 Forward-Port-Of: odoo/odoo#175573