Adrien Widart 4ff8654bcb [FIX] mrp_subcontracting_dropshipping: dropship from PO
Confirming a PO with a customer as delivery address does not work

To reproduce the issue:
1. In Settings, enable "Multi-Locations"
2. Create two products P_finished, P_compo
    - P_finished:
        - Add a vendor V
3. Create a bill of materials:
    - Product: P_finished
    - Type: Subcontract
    - Subcontractor: V
    - Components: 1 x P_compo
4. Create a PO:
    - Vendor: V
    - Products: 1 x P_finished
    - Deliver To: Dropship
    - Drop Ship Address: a customer
5. Confirm the PO

Error: a validation error is displayed: "[...] a mandatory field is not
set. [...] Model: Production Order (mrp.production), Field: Operation
Type (picking_type_id)"

When confirming the PO, we extract some values of the subcontracted SM
to create a MO:
https://github.com/odoo/odoo/blob/829369d3ca0530f1aad0599fbb1598810a928cc3/addons/mrp_subcontracting/models/stock_picking.py#L105-L117
However, because the SM is not created from the SO, it does not have any
`sale_line_id`. And, because its a dropshipped one, neither the SM nor
its picking type has a defined warehouse. As a result, `_get_warehouse`
does not return anything and we can't define the `picking_type_id` of
the MO. This is the reason why the error will be triggered on its
creation.

OPW-2922546

closes odoo/odoo#99223

X-original-commit: 28a20daab6a7097ecd26bf66eeb80b2f5ad294a8
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-08-31 09:31:58 +02:00
…
2022-08-30 08:18:53 +02: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%