OCA / stock-logistics-transport

Transport management in Odoo
GNU Affero General Public License v3.0
60 stars 128 forks source link

[14.0][FIX] shipment_advice: do not copy shipment advice id on moves #123

Open TDu opened 5 months ago

TDu commented 5 months ago

In the case of partially receiving goods, the backorder moves created should not be included in the shipment advice being processed. But it probably makes sense for outgoing move as well.

TDu commented 4 months ago

Thank you.

Should it also be copy=False on stock.move.line?

I do not think it is necessary, at least for what we are trying to fix here, which is handling backorder correctly.

mt-software-de commented 4 months ago

I my opinion this should also be False for stock.move.line, it should be set by https://github.com/OCA/stock-logistics-transport/blob/487d71cce434bf0e817909f0208b64ec42de6c4d/shipment_advice/models/stock_move_line.py#L40 and not from a copy.

OCA-git-bot commented 4 months ago

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

mt-software-de commented 3 months ago

@jbaudoux could you merge this one please?

mt-software-de commented 3 months ago

@jbaudoux could you merge this one please?

ping @OCA/logistics-maintainers ?

mt-software-de commented 3 months ago

What happens when you process with shopfloor and the move is split when you set destination ? Does it remains planned?

For shopfloor_delivery_shipment https://github.com/OCA/wms/blob/14.0/shopfloor_delivery_shipment/services/delivery_shipment.py we should be good.

For shopfloor_reception / shopfloor_reception_shipment_advice this could lead to an error, so i wouldn't remain planned.

I think therefor we should extend _prepare_move_split_vals this would be used in https://github.com/OCA/wms/blob/7bca8fc3bf20d78a161010959c39edaca7c9bb8e/shopfloor_reception/services/reception.py#L1306 which is called by _split

Also there is done_action https://github.com/OCA/wms/blob/7bca8fc3bf20d78a161010959c39edaca7c9bb8e/shopfloor_reception/services/reception.py#L963 which validates the transfer.

mt-software-de commented 2 months ago

shopfloor_reception_shipment_advice needs to be adapted accordingly

I think we can overwrite _prepare_move_split_vals within this PR and set shipment advice id, if a specific context key is set. This context key can then be set in shopfloor_reception_shipment_advice https://github.com/OCA/wms/blob/7bca8fc3bf20d78a161010959c39edaca7c9bb8e/shopfloor_reception/services/reception.py#L963 and https://github.com/OCA/wms/blob/7bca8fc3bf20d78a161010959c39edaca7c9bb8e/shopfloor_reception/services/reception.py#L1282

@TDu when do you plan to do this?

TDu commented 2 months ago

Rebased. I have added a context key in _prepare_move_split_vals I am working on the change in shopfloor_reception_shipment_advice but struggling with the tests there...

mt-software-de commented 2 months ago

I just discussed this topic, again. And right now i don't know where this requirement is coming from anymore. From my point of view i don't see any reason why the link shouldn't be copied within the reception scenario. We will schedule a meeting for this next week.

jbaudoux commented 2 months ago

cc @rousseldenis (fyi)