Wednesday, January 20, 2021
25 changes · master
Enhancements to existing features
This update streamlines how projects, timesheets, sales orders, and invoices work together in Odoo’s service apps. It removes outdated screens and buttons, improves portal timesheet search, and makes billing-related project data more reliable and faster to use.
Original PR description
Purpose ======= This PR is in continuity of #62360 and #62900 done in 14.0. The goal of this PR essentially updates and improves the changes done in 14.0. ## Details - Remove the context key added in…
Purpose
=======
This PR is in continuity of #62360 and #62900 done in 14.0.
The goal of this PR essentially updates and improves the changes done in 14.0.
## Details
- Remove the context key added in 14.0 to keep the 'Create Sale Order' button in task and helpdesk.ticket. Because at the end we remove this button in these models.
- Remove non_allow_billable field in tasks and timesheets.
- Remove the partner_email from task form view.
- Remove timesheet_product_id from task form view
- Merge sale_timesheet_edit module with sale_timesheet module.
- Remove timesheet table in portal sales order and invoice (deprecated templates in #62900).
- Remove override of project kanban controller (deprecated file from #62360).
- Store remaining_hours field in sale.order.line model (this field has been introduced in the following PR #62900).
- Remove _onchange_task_id_employee_id, the process in the method is done in _compute_so_line.
- Merge bill_type and pricing_type in project.project.
- Move partner_id field in project form view.
- Remove value selected in SO and SOL in project if the customer does not fit with the SO selected.
- Changes SOL in mapping when the pricing type of the current project is "employee rate" if the customer changes.
- Hide the timesheet_product_id field if the project is not a fsm project.
- Move sql constraint for timesheet_product_id in industry_fsm_sale, because this field is no longer mandatory in project which is not fsm project.
- Changes the search of timesheets in portal > timesheets.
- we allows the user to search with name of SO and invoice to find the timesheets about the wanted SO or invoice rathan than the id of SOL and invoice.
- Move View Timesheets button in portal > invoice
- Remove deprecated codes.
- Miscellaneous fixes.
Task-2424382
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>This update streamlines how Helpdesk, Field Service, and project timesheets connect to sales and invoicing. It removes redundant ticket actions and fields, improves automatic sales order line selection, and makes reported ticket hours more accurate across user permissions.
Original PR description
Purpose ====== This PR is in continuity of #15025 and #15264 done in 14.0. The goal of this PR essentially updates and improves the changes done in 14.0. ## Details - Remove 'create sale order'…
Purpose
======
This PR is in continuity of #15025 and #15264 done in 14.0.
The goal of this PR essentially updates and improves the changes done in 14.0.
## Details
- Remove 'create sale order' button in helpdesk.ticket.
- Changes the project field in related and stored field and remove task field in helpdesk.ticket model. Because
- we don't need to link a ticket to a task to sale timesheets in ticket.
- the project is always the project defined in the helpdesk.team linked to helpdesk.ticket. That's why this field is now a related and stored field.
- Store sale_line_id field in ticket.
- Merge helpdesk_sale_timesheet_edit module in helpdesk_sale_timesheet module.
- Update the search to get the last SOL of customer set in the helpdesk.ticket.
- compute sudo and store total_hours_spent field in helpdesk.ticket to get the total of all timesheets contained in the ticket.
- Remove bill_type field, because this field has been merged with the pricing_type field in sale_timesheet module.
- Add constraint to check if a timesheet is not linked to a task and a ticket at the same time.
- Restrict the pricing type of helpdesk projects to task rate only.
- Create helpdesk_fsm_sale module to make the bridge between the helpdesk_sale_timesheet and industry_fsm_sale.
- Remove the SO set in the project if this project has been changed to fsm project.
- Move and update the constraint for timesheet_product_id from sale_timesheet to industry_fsm_sale because this field is only required for fsm projects.
- Hide planned_hours, forecast_hours and effective_hours fields in planning.slot form view.
- Remove deprecated code.
Related PRs:
- Community: odoo/odoo#64474
- Upgrade: odoo/upgrade#2080
Task-2424382Resolved issues and error corrections
Point of Sale payment and session forms now prevent users from changing fields that should not be modified after creation or processing. This helps keep transaction and session records accurate by removing edit options where changes could cause inconsistencies.
Original PR description
Description of the issue/feature this PR addresses: The user was able to modify some fields in the pos_payment and pos_session. Current behavior before PR: Some fields were editable. Desired behavior after PR is merged: The fields are now readonly in the form view and the edit button has been removed. Task id: 2394740
Miscellaneous changes
Description of the issue/feature this PR addresses: When sorting product sequence in product list view in web sale. User can not see the correct sorting result . This pr fix it. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64625
Original PR description
Description of the issue/feature this PR addresses: When sorting product sequence in product list view in web sale. User can not see the correct sorting result . This pr fix it. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64625
The manufacturing order screen no longer shows the start button when an order has been cancelled. This prevents users from accidentally trying to begin work on orders that should no longer be processed.
Original PR description
- Hide start button if the MO is cancelled Task ID: 2443977
Mobile form layouts now keep related fields together, such as quantities with their units, instead of forcing every field onto a full-width line. This improves data entry clarity in areas like Time Off and Manufacturing while aligning mobile behavior with desktop forms.
Original PR description
Before this commit o_row class wasn't applied on mobile because we wanted that each field take all width. But we have noticed that this class is quite well used on desktop and is often used for specic cases that we also want on mobile. Example: Unit of measure (UOM) next to a numeric field. So in this commit, we simply removed mobile media queries. Due to the number of places where this class is used, fixes will surely follow. Related to task ID: 1929043
Fleet users can now access vehicle forms without errors when payroll-related tax deduction details are calculated. This prevents interruptions for users managing company vehicles and keeps Belgian payroll fleet workflows running smoothly.
Original PR description
An access right error is raised when the tax_deduction field is computed.
Description of the issue/feature this PR addresses: Preferences for the 'activities' and 'note' subtypes set at the project level are not propagated to their tasks. Current behavior before PR: Preferences for the internal and default subtypes set at the project level should be propagated to its tasks. Desired behavior after PR is merged: Preferences for the internal and default subtypes set at the project level will be propagated to its tasks. LINKS: PR https://github.com/odoo/od
Original PR description
Description of the issue/feature this PR addresses: Preferences for the 'activities' and 'note' subtypes set at the project level are not propagated to their tasks. Current behavior before PR: Preferences for the internal and default subtypes set at the project level should be propagated to its tasks. Desired behavior after PR is merged: Preferences for the internal and default subtypes set at the project level will be propagated to its tasks. LINKS: PR https://github.com/odoo/odoo/pull/47336 Task 2205643 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#62495 Forward-Port-Of: odoo/odoo#47336
Have a product category Inventory Valuation Automatic Create a SO and deliver the product in such category Create return and validate In Journal Entry the accounting move related to return will not have partner id opw-2421393 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 Forward-Port-Of: odoo/odoo#64730
Original PR description
Have a product category Inventory Valuation Automatic Create a SO and deliver the product in such category Create return and validate In Journal Entry the accounting move related to return will not have partner id opw-2421393 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 Forward-Port-Of: odoo/odoo#64730
cache_value could be empty string rather than None. I'm not sure why it was different before. STEPS: * install an app that adds menu Products (e.g. Sales) * activate second language and switch to it * create new product, set some value to field description ("Internal Notes"), save * click edit, remove description, save BEFORE: the value is not removed AFTER: value is empty, translations are removed --- https://github.com/odoo/odoo/commit/543a5523a30c993f60eba3c6d56d54dea2857
Original PR description
cache_value could be empty string rather than None. I'm not sure why it was
different before.
STEPS:
* install an app that adds menu Products (e.g. Sales)
* activate second language and switch to it
* create new product, set some value to field description ("Internal Notes"),
save
* click edit, remove description, save
BEFORE: the value is not removed
AFTER: value is empty, translations are removed
---
https://github.com/odoo/odoo/commit/543a5523a30c993f60eba3c6d56d54dea2857eb3#
opw-2426724
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
Forward-Port-Of: odoo/odoo#64591
Forward-Port-Of: odoo/odoo#64241Use case to reproduce: - Go to MO form produce at least 2 units of a product with a component tracked by serial number. - Edit the producing quantity to 1.0 - Save - Edit the producing quantity to 2.0 The move lines are removed. It happens because the lot_ids field is empty and thus the setter remove the existing stock.move.line. It's empty because the compute try to do a match on existing id. However the stock.move.line in the onchange could have a new virtual id. fine tuning o
Original PR description
Use case to reproduce: - Go to MO form produce at least 2 units of a product with a component tracked by serial number. - Edit the producing quantity to 1.0 - Save - Edit the producing quantity to 2.0 The move lines are removed. It happens because the lot_ids field is empty and thus the setter remove the existing stock.move.line. It's empty because the compute try to do a match on existing id. However the stock.move.line in the onchange could have a new virtual id. fine tuning of commit 8dfee8cb2d60942641b73eaa6489b02aa378c5ac Forward-Port-Of: odoo/odoo#64747
'percentage' is computed by default whatever the wizard action (change_period/change_account) but there is a constraint raised when the percentage is != 100 in change_account. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64736
Original PR description
'percentage' is computed by default whatever the wizard action (change_period/change_account) but there is a constraint raised when the percentage is != 100 in change_account. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64736
The call model.browse('xxx').exists() should not return the record. Instead, it should fail as the string 'xxx' is not a valid ID. Forward-Port-Of: odoo/odoo#64765
Original PR description
The call model.browse('xxx').exists() should not return the record.
Instead, it should fail as the string 'xxx' is not a valid ID.
Forward-Port-Of: odoo/odoo#64765**Description of the issue/feature this PR addresses:** In case the currency is not set during onchange all currency actions will throw a traceback **Current behavior before PR:** Traceback Fun ``` Odoo Server Error Traceback (most recent call last): File ".../odoo/models.py", line 5099, in ensure_one _id, = self._ids ValueError: not enough values to unpack (expected 1, got 0) During handling of the above exception, another exception occurred: Traceback (most recent call l
Original PR description
**Description of the issue/feature this PR addresses:** In case the currency is not set during onchange all currency actions will throw a traceback **Current behavior before PR:** Traceback Fun ```…
**Description of the issue/feature this PR addresses:**
In case the currency is not set during onchange all currency actions will throw a traceback
**Current behavior before PR:**
Traceback Fun
```
Odoo Server Error
Traceback (most recent call last):
File ".../odoo/models.py", line 5099, in ensure_one
_id, = self._ids
ValueError: not enough values to unpack (expected 1, got 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".../odoo/http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File ".../odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File ".../odoo/tools/pycompat.py", line 14, in reraise
raise value
File ".../odoo/http.py", line 669, in dispatch
result = self._call_function(**self.params)
File ".../odoo/http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File ".../odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File ".../odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File ".../odoo/http.py", line 915, in __call__
return self.method(*args, **kw)
File ".../odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File ".../addons/web/controllers/main.py", line 1327, in call_kw
return self._call_kw(model, method, args, kwargs)
File ".../addons/web/controllers/main.py", line 1319, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File ".../odoo/api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File ".../odoo/api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File ".../addons/account/models/account_move.py", line 1014, in onchange
return super(AccountMove, self.with_context(recursive_onchanges=False)).onchange(values, field_name, field_onchange)
File ".../odoo/models.py", line 6247, in onchange
record._onchange_eval(name, field_onchange[name], result)
File ".../odoo/models.py", line 6026, in _onchange_eval
method_res = method(self)
File ".../addons/purchase/models/account_invoice.py", line 75, in _onchange_purchase_auto_complete
self._onchange_currency()
File ".../addons/account/models/account_move.py", line 389, in _onchange_currency
self._recompute_dynamic_lines(recompute_tax_base_amount=True)
File ".../addons/account/models/account_move.py", line 1000, in _recompute_dynamic_lines
invoice._recompute_payment_terms_lines()
File ".../addons/account/models/account_move.py", line 962, in _recompute_payment_terms_lines
new_terms_lines = _compute_diff_payment_terms_lines(self, existing_terms_lines, account, to_compute)
File ".../addons/account/models/account_move.py", line 914, in _compute_diff_payment_terms_lines
if self.journal_id.company_id.currency_id.is_zero(balance) and len(to_compute) > 1:
File ".../odoo/addons/base/models/res_currency.py", line 171, in is_zero
self.ensure_one()
File ".../odoo/models.py", line 5102, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: res.currency()
```
**Desired behavior after PR is merged:**
Preparation of not yet saved purchase invoice works as expected
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#64502
Forward-Port-Of: odoo/odoo#64339To fully allow f4e67d8ae174d7e2ee75a1de1083b31a6ff2af8b we need also to disable to check on account when the constraint field has been used to set the account on the journal opw-2394959 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 Forward-Port-Of: odoo/odoo#64667
Original PR description
To fully allow f4e67d8ae174d7e2ee75a1de1083b31a6ff2af8b we need also to disable to check on account when the constraint field has been used to set the account on the journal opw-2394959 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 Forward-Port-Of: odoo/odoo#64667
Before this commit, the `on_attach_callback` and `on_detach_callback` callbacks are not called all the time on the `Dialog` widget when it's attached/detached to the DOM. Relying on those callbacks could result in unpredictable behaviours. To be more precise, the `on_attach_callback` isn't executed on a regular Dialog#open() call. But executing a client action into a Dialog will execute it (due to being called by the ActionManager). This difference prevents from properly binding those
Original PR description
Before this commit, the `on_attach_callback` and `on_detach_callback` callbacks are not called all the time on the `Dialog` widget when it's attached/detached to the DOM. Relying on those callbacks…
Before this commit, the `on_attach_callback` and `on_detach_callback` callbacks are not called all the time on the `Dialog` widget when it's attached/detached to the DOM. Relying on those callbacks could result in unpredictable behaviours. To be more precise, the `on_attach_callback` isn't executed on a regular Dialog#open() call. But executing a client action into a Dialog will execute it (due to being called by the ActionManager). This difference prevents from properly binding those callbacks later on through an extend or include of the Dialog widget as we have no way to know if they have already been called or not (e.g. which can result in calling them twice). This commit normalize this situation by ensuring that the `on_attach_callback` and `on_detach_callback` callbacks are properly called by the Dialog widget and allows any extension of this widget to rely on them. Therefore the ActionManager is adapted accordingly. opw-2438534 Forward-Port-Of: odoo/odoo#64780
Some added readonly attributes in the unbuild form view were overriding the `states={'done': [('readonly', True)]}` attributes in the models' fields. So we add the readonly when state='done' to the view as well. Note that same issue exists in saas-12.3 and 13.0, but only for 2 of the 4 fields fixed in this commit (i.e. it probably isn't a big deal for these older versions.) Discovered during task: 2033341 Description of the issue/feature this PR addresses: Current behavior before
Original PR description
Some added readonly attributes in the unbuild form view were overriding
the `states={'done': [('readonly', True)]}` attributes in the models'
fields. So we add the readonly when state='done' to the view as well.
Note that same issue exists in saas-12.3 and 13.0, but only for 2 of the
4 fields fixed in this commit (i.e. it probably isn't a big deal for
these older versions.)
Discovered during task: 2033341
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
Forward-Port-Of: odoo/odoo#63537…paid lines Create a promotion auto applied with 0 minimum amount on any product in catalog. Have a DEMO product invoiced on delivery Create a sale order with DEMO, apply the promotion. Confirm. Click on 'Create Invoice'. The invoice will only contain the promotion because the line for DEMO is to be invoiced only after delivery, while by default the promotion product has the invoice policy 'on order' opw-2414630 Description of the issue/feature this PR addresses: Current beh
Original PR description
…paid lines Create a promotion auto applied with 0 minimum amount on any product in catalog. Have a DEMO product invoiced on delivery Create a sale order with DEMO, apply the promotion. Confirm. Click on 'Create Invoice'. The invoice will only contain the promotion because the line for DEMO is to be invoiced only after delivery, while by default the promotion product has the invoice policy 'on order' opw-2414630 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 Forward-Port-Of: odoo/odoo#64721 Forward-Port-Of: odoo/odoo#63717
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 Forward-Port-Of: odoo/odoo#64799
Original PR description
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 Forward-Port-Of: odoo/odoo#64799
task-2388600 Forward-Port-Of: odoo/odoo#62446
Original PR description
task-2388600 Forward-Port-Of: odoo/odoo#62446
With the switch to Owl, some code is now (temporarily) asynchronous, because we need to go through multiple phases of rendering. Because of that, we need to wait for all of it to be done. Forward-Port-Of: odoo/enterprise#15861
Original PR description
With the switch to Owl, some code is now (temporarily) asynchronous, because we need to go through multiple phases of rendering. Because of that, we need to wait for all of it to be done. Forward-Port-Of: odoo/enterprise#15861
The fields product_line_ids, amount, quantity were still editable when the request was approved. opw:2431149 Forward-Port-Of: odoo/enterprise#15837
Original PR description
The fields product_line_ids, amount, quantity were still editable when the request was approved. opw:2431149 Forward-Port-Of: odoo/enterprise#15837
Since commit odoo/enterprise@96beff3d22e7083ec7a51d29fc6fdaef29cee912 the BackButtonEventMixin (via its BackButtonManager) prevents from registering multiple times the same Widget/Components's instance as a listener for the "backbutton" event (available in the mobile app). Sadly the Dialog widget original implementation didn't call the `on_attach_callback` and `on_detach_callback` callbacks which required us to implement them in our Dialog's implementation of the backbutton. But. I
Original PR description
Since commit odoo/enterprise@96beff3d22e7083ec7a51d29fc6fdaef29cee912 the BackButtonEventMixin (via its BackButtonManager) prevents from registering multiple times the same Widget/Components's…
Since commit odoo/enterprise@96beff3d22e7083ec7a51d29fc6fdaef29cee912 the BackButtonEventMixin (via its BackButtonManager) prevents from registering multiple times the same Widget/Components's instance as a listener for the "backbutton" event (available in the mobile app). Sadly the Dialog widget original implementation didn't call the `on_attach_callback` and `on_detach_callback` callbacks which required us to implement them in our Dialog's implementation of the backbutton. But. In some cases, `on_attach_callback` was actually called (specifically when a client action is opened in a dialog), resulting in this callback being executed twice! And since the BackButtonManager is stricter, calling this callback a second time results in a "Listener already registered!" error. This commit is a followup of its counterpart in community which makes Dialog reliably call those callbacks. This allows to simplify the implementation of the Dialog's backbutton support. Also, the related test verify that the native method `overrideBackButton` is properly called like the other "backbutton" tests. opw-2438534 Forward-Port-Of: odoo/enterprise#15849
If an account like "251.04.01" with the tag "251.04 Acreedores diversos a largo plazo nacional parte relacionada" is present in a mexican COA report, the account will be considered as misconfigured and the export for SAT button will trigger an error. In the code, the domain used in the report for the code "MX_COA_251" contained two times the tag "251.03" and no mention of "251.04". Thus the tag "251.04" was added in the report and now accounts with this tags are no longer considered as mi
Original PR description
If an account like "251.04.01" with the tag "251.04 Acreedores diversos a largo plazo nacional parte relacionada" is present in a mexican COA report, the account will be considered as misconfigured and the export for SAT button will trigger an error. In the code, the domain used in the report for the code "MX_COA_251" contained two times the tag "251.03" and no mention of "251.04". Thus the tag "251.04" was added in the report and now accounts with this tags are no longer considered as misconfigured. opw-2424711 Forward-Port-Of: odoo/enterprise#15807
Commit [1] changed the design of the HTML field to not hack the default style. It is now decided that the hack is worth it. [1]: https://github.com/odoo/enterprise/commit/6b3643d8789d246095876d8da9a706ce9c5dd137 Forward-port of https://github.com/odoo/enterprise/pull/14196 Forward-Port-Of: odoo/enterprise#15826
Original PR description
Commit [1] changed the design of the HTML field to not hack the default style. It is now decided that the hack is worth it. [1]: https://github.com/odoo/enterprise/commit/6b3643d8789d246095876d8da9a706ce9c5dd137 Forward-port of https://github.com/odoo/enterprise/pull/14196 Forward-Port-Of: odoo/enterprise#15826