Skip to content

Conversation

@lmignon
Copy link
Contributor

@lmignon lmignon commented Jul 9, 2025

Automatically move remaining quants with a past removal date out of stocks

@lmignon lmignon force-pushed the 16.0-add-stock_expired_lot_move-lmi branch 2 times, most recently from bbf6dbe to 6901647 Compare July 9, 2025 15:16
@lmignon lmignon marked this pull request as ready for review July 9, 2025 15:23
@lmignon
Copy link
Contributor Author

lmignon commented Jul 9, 2025

ping @rousseldenis @jbaudoux

@lmignon lmignon force-pushed the 16.0-add-stock_expired_lot_move-lmi branch 3 times, most recently from 1a245e6 to ae5fed1 Compare July 9, 2025 15:35
@rousseldenis rousseldenis added this to the 16.0 milestone Jul 10, 2025
Copy link
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

Seems great. Some remarks

return [
("usage", "=", "internal"),
("warehouse_id", "=", self.warehouse_id.id),
("location_id", "child_of", self.warehouse_id.lar_orig_location_id.id),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not using the picking type to determine source and destination (default_location_src_id and default_location_dest_id fields) as this is the default Odoo behavior ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The source location will become a M2M to allows a fine grained selection of the locations to consider

@rousseldenis
Copy link
Contributor

Note: When moves are in packages not already done, we shouldn't do the process.

Copy link
Contributor

@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.

partial review

Comment on lines 17 to 18
default=lambda self: self.env.context.get("active_model") == "stock.warehouse"
and self.env.context.get("active_id", False),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you have an active warehouse on user when you are in multi-wh. Would be nice to respect that

Comment on lines 27 to 28
removal_date = fields.Date(
string="Expiration Date",
Copy link
Contributor

Choose a reason for hiding this comment

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

date_limit ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is it better?

@lmignon lmignon force-pushed the 16.0-add-stock_expired_lot_move-lmi branch from ae5fed1 to 26f7184 Compare July 10, 2025 12:24
@lmignon lmignon changed the title [16.0][ADD] stock_lot_auto_remove: Auto remove quants [16.0][ADD] stock_lot_remove: Remove quants with a past removal date Jul 10, 2025
@lmignon lmignon force-pushed the 16.0-add-stock_expired_lot_move-lmi branch from 26f7184 to 475986e Compare July 10, 2025 12:49
@lmignon
Copy link
Contributor Author

lmignon commented Jul 10, 2025

Note: When moves are in packages not already done, we shouldn't do the process.

I now exclude quants into packages.

@lmignon lmignon force-pushed the 16.0-add-stock_expired_lot_move-lmi branch 3 times, most recently from a5a473e to 25859f2 Compare July 10, 2025 13:16
@lmignon lmignon force-pushed the 16.0-add-stock_expired_lot_move-lmi branch 2 times, most recently from 9b796d3 to b307dff Compare July 18, 2025 13:58
@lmignon lmignon force-pushed the 16.0-add-stock_expired_lot_move-lmi branch from b307dff to 8f7bc92 Compare July 18, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants