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
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
2785319
[MIG] stock_quant_manual_assign: Migration to 10.0
fanha99 Jul 26, 2017
0e0bd63
11.0-mig-stock_quant_manual_assign
fanha99 Dec 28, 2017
83366b5
[MIG] stock_quant_manual_assign: Migration to 11.0
cubells Nov 12, 2018
40aefd8
[IMP] stock_quant_manual_assign:
pedrobaeza Nov 20, 2018
02d8e47
[FIX] stock_quant_manual_assign: Related fields are not filled if not…
pedrobaeza Nov 21, 2018
abd77b7
[IMP] stock_quant_manual_assign: Add owner to criteria + reorder fiel…
pedrobaeza Jan 20, 2019
f83e7bc
[UPD] Update stock_quant_manual_assign.pot
oca-travis Jan 20, 2019
a60b752
[12.0][MIG] stock_quant_manual_assign
LoisRForgeFlow Jul 11, 2019
9e4ecf7
[IMP] stock_quant_manual_assign: black, isort, prettier
digitalsatori Apr 1, 2020
1aa5ccf
[MIG] stock_quant_manual_assign: Migration to 13.0
digitalsatori Apr 1, 2020
ad07824
[UPD] Update stock_quant_manual_assign.pot
oca-travis Sep 4, 2020
268e9c7
[UPD] README.rst
OCA-git-bot Sep 4, 2020
46b178d
Update translation files
oca-transbot Sep 8, 2020
d1ce44d
[UPD] Eficent -> ForgeFlow
MiquelRForgeFlow Sep 30, 2020
49dc221
[UPD] README.rst
OCA-git-bot Oct 1, 2020
ecbc9cf
Update translation files
oca-transbot Nov 22, 2020
c2bbad6
[MIG] stock_quant_manual_assign: Migration to 14.0
fanha99 Dec 4, 2020
37aa1b7
[UPD] Update stock_quant_manual_assign.pot
oca-travis Jun 10, 2021
2853b4a
[UPD] README.rst
OCA-git-bot Jun 10, 2021
021b070
[IMP] stock_quant_manual_assign: make qty_done fill optional
yostashiro Jan 13, 2021
587847b
[IMP] stock_quant_manual_assign: add prepare lines method
LoisRForgeFlow Jul 27, 2021
f5b362e
[UPD] Update stock_quant_manual_assign.pot
oca-travis Jul 27, 2021
5c8a14d
stock_quant_manual_assign 14.0.1.1.0
OCA-git-bot Jul 27, 2021
bb51885
Update translation files
oca-transbot Jul 27, 2021
e963113
Translated using Weblate (French)
remi-filament Sep 18, 2021
3af77db
[MIG] stock_quant_manual_assign: Migration to 15.0
JasminSForgeFlow Jan 19, 2022
0264c93
[UPD] Update stock_quant_manual_assign.pot
Jan 19, 2022
bdf88e6
[UPD] README.rst
OCA-git-bot Jan 19, 2022
4500679
[IMP] stock_quant_manual_assign: make several columns sortable in wizard
MiquelRForgeFlow Jun 17, 2022
770c959
stock_quant_manual_assign 15.0.1.1.0
OCA-git-bot Jun 21, 2022
30cbce6
[FIX] stock_quant_manual_assign: fix access error issues
LoisRForgeFlow Jul 12, 2022
236115c
stock_quant_manual_assign 15.0.1.1.1
OCA-git-bot Jul 12, 2022
8ca4ae7
[IMP] stock_quant_manual_assign: make quant search flexible
yostashiro Jan 27, 2021
b254ddb
stock_quant_manual_assign 15.0.1.2.0
OCA-git-bot Oct 7, 2022
188f599
[MIG] stock_quant_manual_assign to v16
alexis-via Oct 29, 2022
6f964ad
[IMP] stock_quant_manual_assign: use toggle widget on selected field
alexis-via Oct 29, 2022
619125c
[FIX] stock_quant_manual_assign: Bug #1527
yankinmax May 16, 2023
5f7ba7d
[FIX] stock_quant_manual_assign: #1460 set Others reserved as readonly
yankinmax May 16, 2023
6040cef
[IMP] stock_quant_manual_assign: Refactor quants_lines creation
yankinmax May 16, 2023
dac27ac
[UPD] Update stock_quant_manual_assign.pot
May 18, 2023
561723e
Update translation files
weblate May 18, 2023
5cdac1d
Translated using Weblate (Italian)
mymage May 18, 2023
d4bd9aa
Translated using Weblate (Italian)
mymage May 24, 2023
3d8b049
Translated using Weblate (Italian)
mymage Jun 7, 2023
3c9f93f
[FIX] stock_quant_manual_assign
xavier-bouquiaux Jul 11, 2023
3bcc65c
Translated using Weblate (Italian)
francesco-ooops Jul 12, 2023
3437f69
stock_quant_manual_assign 16.0.1.0.1
OCA-git-bot Jul 17, 2023
f0986dc
Translated using Weblate (Spanish)
Ivorra78 Jul 27, 2023
696d206
[UPD] README.rst
OCA-git-bot Sep 3, 2023
6fbf54d
Update translation files
weblate Oct 9, 2023
fb72bef
Translated using Weblate (Spanish)
Ivorra78 Oct 26, 2023
38d9f2b
Translated using Weblate (Italian)
mymage Oct 29, 2023
c2ad3ca
Translated using Weblate (French)
Nov 2, 2023
9cd99c7
Translated using Weblate (Italian)
mymage Nov 17, 2023
fad14ff
Translated using Weblate (Italian)
mymage Nov 21, 2023
b32f1c1
Translated using Weblate (Japanese)
liuhehe1995 Nov 24, 2023
7a4bbc1
Translated using Weblate (Italian)
mymage Dec 18, 2023
33c3e45
[17.0-mig-stock] [IMP] stock_quant_manual_assign: pre-commit stuff
siemenv Mar 25, 2024
df7b89c
[17.0-mig-stock] [MIG] stock_quant_manual_assign: Migration to 17.0
siemenv Mar 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stock_quant_manual_assign/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

"version": "17.0.1.0.0",
"category": "Warehouse",
"license": "AGPL-3",
"author": "AvanzOSC, "
Expand Down
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.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def setUpClass(cls):
"location_id": cls.location_src.id,
}
)
cls.picking_type = cls.env.ref("stock.picking_type_out")
cls.picking_type = cls.env.ref("stock.warehouse0").out_type_id
cls.quant1 = cls.quant_model.sudo().create(
{
"product_id": cls.product.id,
Expand Down Expand Up @@ -100,7 +100,7 @@ def test_quant_assign_wizard(self):
self.assertEqual(wizard.lines_qty, 0.0, "None selected must give 0")
self.assertEqual(
sum(line.qty for line in wizard.quants_lines),
self.move.reserved_availability,
self.move.quantity,
)
self.assertEqual(wizard.move_qty, self.move.product_uom_qty)

Expand Down Expand Up @@ -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.

self.assertEqual(sum(self.move.move_line_ids.mapped("quantity")), 0.0)

def test_quant_manual_assign_auto_fill_qty_done(self):
wizard = self.quant_assign_wizard.with_context(active_id=self.move.id).create(
Expand All @@ -162,7 +162,7 @@ def test_quant_manual_assign_auto_fill_qty_done(self):
self.picking_type.auto_fill_qty_done = True
wizard.assign_quants()
self.assertTrue(self.move.picking_type_id.auto_fill_qty_done)
self.assertEqual(sum(self.move.move_line_ids.mapped("qty_done")), 150.0)
self.assertEqual(sum(self.move.move_line_ids.mapped("quantity")), 150.0)

def test_quant_assign_wizard_after_availability_check(self):
self.move._action_assign()
Expand All @@ -186,5 +186,5 @@ def test_quant_assign_wizard_after_availability_check(self):
)
self.assertEqual(
sum(line.qty for line in wizard.quants_lines),
self.move.reserved_availability,
self.move.quantity,
)
4 changes: 2 additions & 2 deletions stock_quant_manual_assign/views/stock_move_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<button name="action_show_details" position="before">
<button name="action_assign_serial" position="before">
<button
name="%(assign_manual_quants_action)d"
type="action"
icon="fa-tags"
title="Manual Quants"
options='{"warn": true}'
attrs="{'invisible':['|',('picking_code','=','incoming'),('state','not in',('confirmed','assigned','partially_available'))]}"
invisible="picking_code == 'incoming' or state not in ['confirmed','assigned','partially_available']"
/>
</button>
</field>
Expand Down
8 changes: 3 additions & 5 deletions stock_quant_manual_assign/views/stock_picking_type_views.xml
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.

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='show_reserved']" position="after">
<field
name="auto_fill_qty_done"
attrs="{'invisible':[('code','=','incoming')]}"
/>
<xpath expr="//field[@name='create_backorder']" position="after">
<field name="code" invisible="1" />
<field name="auto_fill_qty_done" invisible="code == 'incoming'" />
</xpath>
</field>
</record>
Expand Down
12 changes: 4 additions & 8 deletions stock_quant_manual_assign/wizard/assign_manual_quants.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ def assign_quants(self):
move._do_unreserve()
for line in self.quants_lines:
line._assign_quant_line()
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
move._recompute_state()
move.mapped("picking_id")._compute_state()
return {}
Expand Down Expand Up @@ -115,7 +111,7 @@ def _prepare_wizard_line(self, move, quant):
and ml.package_id == quant.package_id
)
)
line["qty"] = sum(move_lines.mapped("reserved_uom_qty"))
line["qty"] = sum(move_lines.mapped("quantity_product_uom"))
line["selected"] = bool(line["qty"])
line["reserved"] = quant.reserved_quantity - line["qty"]
return line
Expand Down Expand Up @@ -200,11 +196,11 @@ def _check_qty(self):
quant = record.quant_id
move_lines = record.assign_wizard.move_id.move_line_ids.filtered(
lambda ml: (
ml.location_id == quant.location_id and ml.lot_id == quant.lot_id
ml.location_id == quant.location_id and ml.lot_id == quant.lot_id # noqa: B023
)
)
reserved = quant.reserved_quantity - sum(
move_lines.mapped("reserved_uom_qty")
move_lines.mapped("quantity_product_uom")
)
if (
float_compare(
Expand Down Expand Up @@ -247,8 +243,8 @@ def _assign_quant_line(self):
return
move._update_reserved_quantity(
self.qty,
available_quantity,
self.quant_id.location_id,
self.quant_id,
lot_id=self.quant_id.lot_id,
package_id=self.quant_id.package_id,
owner_id=self.quant_id.owner_id,
Expand Down
12 changes: 4 additions & 8 deletions stock_quant_manual_assign/wizard/assign_manual_quants_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@
<field name="package_id" groups="stock.group_tracking_lot" />
<field name="owner_id" groups="stock.group_tracking_owner" />
<field name="location_id" />
<field name="on_hand" force_save="1" />
<field name="reserved" force_save="1" />
<field name="selected" widget="boolean_toggle" />
<field
name="qty"
attrs="{'readonly':[('selected', '=', False)]}"
sum="qty"
/>
<field name="on_hand" />
<field name="reserved" />
<field name="selected" />
<field name="qty" readonly="selected == False" sum="qty" />
</tree>
</field>
<group col='4' colspan="4">
Expand Down
Loading