-
-
Notifications
You must be signed in to change notification settings - Fork 733
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
Conversation
* 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.
…ds + add security groups + hook
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/
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/
431304d
to
4d86f70
Compare
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
/ocabot migration stock_quant_manual_assign |
When testing, I get the following error. I would suggest to remove it like here: #1792 |
There was a problem hiding this 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")) |
There was a problem hiding this comment.
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"
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
4d86f70
to
df7b89c
Compare
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@siemenv Hello! Can you please take a look at the last comments? |
@rousseldenis Hi Roussel! What about if we reopen the PR #2071 and we continue the migration there. We need this module asap. Thanks! |
@HviorForgeFlow Hi Hector! What about if we reopen the PR #2071 and we continue the migration there. We need this module asap. Thanks! |
@mav-adhoc Ok, @siemenv seems inactive. |
No description provided.