Adrien Widart 63ef74bdee [FIX] {sale,sale_purchase,purchase}_stock: cancel SO linked with a PO
When the user cancels a SO, if there is an associated PO, there won't be
any activity logged on the PO about the SO cancellation.

To reproduce the issue:
1. Unarchive the MTO route
2. Create a product P:
    - Type: Storable
    - Routes: MTO & Buy
    - Add a vendor V
3. Create and confirm a SO with 1 x P
    - Note: a PO is generated
4. Cancel the SO
5. Open the PO

Error: There isn't any information about the cancellation of the SO. An
activity should be added to the PO.

Since [1], if the PO is a draft, we no longer log an activity when the
quantity of the related SO is reduced:
https://github.com/odoo/odoo/blob/3bd9b7a77a1e0e05ea479945d5cd8085f6981feb/addons/purchase_stock/models/stock.py#L103-L105

However, when cancelling a SO, we call the activity logger:
https://github.com/odoo/odoo/blob/846ad1f978fe36db892a9902bb4657c2079d1756/addons/sale_stock/models/sale_order.py#L184-L189
So, since the PO is not yet confirmed, we ignore it and do not log any
activity

[1] bda3225c6cc27bb2c2933eda3cc68c6f9708daf3

OPW-2820242

closes odoo/odoo#90553

X-original-commit: de485a39c9ee88aa31f9330a468ad31cc05842bc
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-05-05 16:22:52 +02:00
2022-04-23 07:37:55 +02:00
…
…
…
2021-10-07 17:59:53 +00:00
2022-01-14 15:44:52 +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%