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

[17.0][MIG] stock_quant_manual_assign: Migration to 17.0 #1973

Open
wants to merge 59 commits into
base: 17.0
Choose a base branch
from

Conversation

siemenv
Copy link

@siemenv siemenv commented Mar 25, 2024

No description provided.

fanha99 and others added 30 commits March 25, 2024 20:28
* Better layout
* Remove active_id dependency in some computed fields
* Clean code
* Refine constraint
* Take into account if the current line is previously reserved before clicking on the button.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-13.0/stock-logistics-warehouse-13.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_quant_manual_assign/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-13.0/stock-logistics-warehouse-13.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_quant_manual_assign/
There are cases where auto-filling of qty_done of stock move line is not desirable.
e.g. you assign quants manually for some of the moves in a picking and not the others,
in such case you need to go over all the moves in the picking to either remove qty_done
or fill it in to proceed with the validation of the entire moves. Auto-fill behavior is
also troublesome when this function is used in a manufacturing order. i.e. having
qty_done of the component move live messes up the outcome of the production.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-14.0/stock-logistics-warehouse-14.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_quant_manual_assign/
Currently translated at 100.0% (31 of 31 strings)

Translation: stock-logistics-warehouse-14.0/stock-logistics-warehouse-14.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_quant_manual_assign/fr/
xavier-bouquiaux and others added 14 commits March 25, 2024 20:28
some minor change in code +
on real bug in screen -> readonly fields needs a force_save on the view
Currently translated at 44.1% (15 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/it/
Currently translated at 100.0% (34 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/
Currently translated at 100.0% (34 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/es/
Currently translated at 44.1% (15 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/it/
Currently translated at 100.0% (34 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/fr/
Currently translated at 44.1% (15 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/it/
Currently translated at 100.0% (34 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/it/
Currently translated at 100.0% (34 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/ja/
Currently translated at 100.0% (34 of 34 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_quant_manual_assign
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_quant_manual_assign/it/
@siemenv siemenv marked this pull request as draft March 25, 2024 20:29
@siemenv siemenv force-pushed the 17.0-mig-stock_quant_manual_assign branch 2 times, most recently from 431304d to 4d86f70 Compare March 28, 2024 12:51
@siemenv siemenv marked this pull request as ready for review March 28, 2024 12:51
Comment on lines 66 to 69
if move.picking_type_id.auto_fill_qty_done:
# Auto-fill all lines as done
for ml in move.move_line_ids:
ml.qty_done = ml.reserved_uom_qty
ml.quantity = ml.quantity
Copy link
Author

Choose a reason for hiding this comment

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

I need help for this part. What functionality does "auto_fill_qty_done" need to have? In V17 there is no distinction between reserved and done quantity on stock move lines as far as I can see.

Copy link
Contributor

Choose a reason for hiding this comment

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

the field qty_done is removed in 17.0, so I think we don't need to care about it.

@rousseldenis
Copy link
Sponsor Contributor

/ocabot migration stock_quant_manual_assign

@BT-jmichaud
Copy link

When testing, I get the following error.
We have the same problem in 16.0.
The toogle button does not work here.

I would suggest to remove it like here: #1792

image

Copy link
Contributor

@fanha99 fanha99 left a comment

Choose a reason for hiding this comment

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

just few comment.

reserved = quant.reserved_quantity - sum(
move_lines.mapped("reserved_uom_qty")
)
reserved = quant.reserved_quantity - sum(move_lines.mapped("quantity"))
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 need to map the "quantity_product_uom" instead of just "quantity"

Comment on lines 66 to 69
if move.picking_type_id.auto_fill_qty_done:
# Auto-fill all lines as done
for ml in move.move_line_ids:
ml.qty_done = ml.reserved_uom_qty
ml.quantity = ml.quantity
Copy link
Contributor

Choose a reason for hiding this comment

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

the field qty_done is removed in 17.0, so I think we don't need to care about it.

cls.picking_type_out = cls.ModelDataObj._xmlid_to_res_id(
"stock.picking_type_out"
)
cls.picking_type_out = cls.env.ref("stock.warehouse0").out_type_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 need to change these code? how about multi stock, multi warehouse

@siemenv siemenv force-pushed the 17.0-mig-stock_quant_manual_assign branch from 4d86f70 to df7b89c Compare May 29, 2024 06:02
Copy link
Contributor

Choose a reason for hiding this comment

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

because of qty_done was removed in 17.0, so this file is no need any more.

@@ -7,7 +7,7 @@

{
"name": "Stock - Manual Quant Assignment",
"version": "16.0.1.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

last version is 16.0.1.1.0, so please pick the last one.
beside, you can take a look at PR #2038.

@@ -149,7 +149,7 @@ def test_quant_manual_assign(self):
"There are 2 quants selected",
)
self.assertFalse(self.move.picking_type_id.auto_fill_qty_done)
self.assertEqual(sum(self.move.move_line_ids.mapped("qty_done")), 0.0)
Copy link
Contributor

Choose a reason for hiding this comment

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

because of "qty_done" was removed in 17.0, so I think we don't need these test case.

Copy link
Contributor

Choose a reason for hiding this comment

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

you can take a look at https://www.odoo.com/documentation/17.0/developer/reference/backend/testing.html#
It will help to save time, by test it yourself before make pull request.

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.

None yet