kdeb@odoo.com a81319bf6c [FIX] sale_timesheet: resolve NewId error on SO-Linked tasks
Issue:
    - When adding tasks to a contact using Studio
     and attempting to set a task's project to a
     project linked to a Sales Order (SO),
     we encounter the following error:
     "TypeError: 'NewId' object is not iterable."

Steps To Reproduce (in 17.0):
    - In a contact form open Studio and add a O2M field Customer (Task)
    - Create a new task in the O2M and set the Project to a project
    related to a SO.
    - Notice Traceback Error "TypeError: 'NewId' object is not iterable"

Solution:
    - The issue arises in the search domain of
    _get_last_sol_of_customer , where the domain is
    ('order_partner_id', 'child_of',
    self.partner_id.commercial_partner_id.id),
    where the type of `self.partner_id.commercial_partner_id.id`
    is NewId since the partner is being edited to add a task.
    This action triggers the `parse` and `to_ids` methods with
    a value type of NewId. thus the error.

    - The operator child_of expects a list of IDs, and the ids
    property refer to the record's origin ids.to resolve this,
    replace `commercial_partner_id.id` with `commercial_partner_id.ids`.

opw-3760372

closes odoo/odoo#157318

Signed-off-by: Raphael Collet <rco@odoo.com>
2024-03-22 11:20:05 +00:00
2024-03-22 09:44:37 +00:00
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%