Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from

Conversation

TDu
Copy link
Member

@TDu TDu commented Apr 23, 2024

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.

Copy link
Contributor

@mt-software-de mt-software-de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

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

@TDu
Copy link
Member Author

TDu commented May 7, 2024

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
Copy link
Contributor

I my opinion this should also be False for stock.move.line, it should be set by

def _load_in_shipment(self, shipment_advice):
and not from a copy.

Copy link
Contributor

@mt-software-de mt-software-de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

shipment_advice/tests/test_shipment_advice.py Outdated Show resolved Hide resolved
@OCA-git-bot
Copy link
Contributor

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). 🤖

@TDu TDu force-pushed the 14-shipment-advice-fix-backorder-move branch from d2e8bf4 to fd17878 Compare May 14, 2024 10:02
@mt-software-de
Copy link
Contributor

@jbaudoux could you merge this one please?

@mt-software-de
Copy link
Contributor

@jbaudoux could you merge this one please?

ping @OCA/logistics-maintainers ?

Copy link

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mt-software-de
Copy link
Contributor

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.

Copy link

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shopfloor_reception_shipment_advice needs to be adapted accordingly

@mt-software-de
Copy link
Contributor

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 added 2 commits July 12, 2024 08:45
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 TDu force-pushed the 14-shipment-advice-fix-backorder-move branch from 46152a5 to 5a708af Compare July 12, 2024 06:47
@TDu
Copy link
Member Author

TDu commented Jul 12, 2024

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
Copy link
Contributor

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
Copy link

cc @rousseldenis (fyi)

Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 10, 2024

def _prepare_move_split_vals(self, qty):
vals = super()._prepare_move_split_vals(qty)
if self.env.context.get("shipment_advice__propagate_on_split"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TDu @jbaudoux Why this key of context ?

Shouldn't it be possible to use the stock rule that has created the move and a property on it to do the same ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as Information, we discussed this topic some weeks ago and there was no scenario where the id should not be copied. All of the cases in shopfloor as example would need the value.
So i think we should close this one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this PR is not used on customer projects, I would say it can be closed.
Although I think the copy=False makes some sense.

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants