odoo/odoo#75065

Created by pedrobaeza
Closed
label
Tecnativa:13.0-mrp_subcontracting-produce_before_consumption
head
721b4952f6015b86de132d593707ecad70f9b49f
odoo/odoo
13.0 #75065

[13.0][FIX] mrp_subcontracting: Consume after producing

With previous code, the call to super is done before doing all the producing stuff, so the consumption takes place before the stock is available. This is not a problem if you don't have any kind of negative stock levels control, as first a negative quant is created, and when the production is done, the negative quant is neutralized.

But if you start using the OCA module stock_no_negative, then the negative stock exception raises, and you are not able to finish the subcontracting reception.

Swapping the super call order, means another thing: the backorder is created after the producing code, so we need to filter out the lines that are not being received.

A new test has been included for checking the partial reception flow.

@Tecnativa TT31389