Skip to content

Commit

Permalink
[MIG] mrp_production_quant_manual_assign: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MeritxellAForgeFlow committed Feb 3, 2025
1 parent 6081366 commit 36f4313
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mrp_production_quant_manual_assign/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Production - Manual Quant Assignment",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Manufacturing",
"license": "AGPL-3",
"author": "Quartile Limited, ForgeFlow, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='move_raw_ids']//button[@name='action_show_details']"
expr="//field[@name='move_raw_ids']//field[@name='group_id']"
position="before"
>
<button
Expand All @@ -15,7 +15,7 @@
icon="fa-tags"
title="Manual Quants"
options='{"warn": true}'
attrs="{'invisible':[('state','not in',('confirmed','assigned','partially_available'))]}"
invisible="state not in ('confirmed','assigned','partially_available')"
/>
</xpath>
</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def _prepare_wizard_line(self, move, quant):
and ml.package_id == quant.package_id
)
)
line["qty_done"] = sum(move_lines.mapped("qty_done"))
line["to_consume_now"] = bool(line["qty_done"])
line["quantity"] = sum(move_lines.mapped("quantity"))
line["to_consume_now"] = bool(line["quantity"])
return line

Check warning on line 42 in mrp_production_quant_manual_assign/wizards/assign_manual_quants.py

View check run for this annotation

Codecov / codecov/patch

mrp_production_quant_manual_assign/wizards/assign_manual_quants.py#L40-L42

Added lines #L40 - L42 were not covered by tests

def assign_quants(self):
Expand All @@ -53,18 +53,18 @@ def assign_quants(self):
).mapped("lot_id")
for ml in move.move_line_ids:
if ml.lot_id in lots_to_consume:
ml.qty_done = ml.reserved_uom_qty
ml.quantity = ml.reserved_uom_qty

Check warning on line 56 in mrp_production_quant_manual_assign/wizards/assign_manual_quants.py

View check run for this annotation

Codecov / codecov/patch

mrp_production_quant_manual_assign/wizards/assign_manual_quants.py#L56

Added line #L56 was not covered by tests
elif float_is_zero(
ml.reserved_uom_qty, precision_digits=precision_digits
):
ml.unlink()

Check warning on line 60 in mrp_production_quant_manual_assign/wizards/assign_manual_quants.py

View check run for this annotation

Codecov / codecov/patch

mrp_production_quant_manual_assign/wizards/assign_manual_quants.py#L60

Added line #L60 was not covered by tests
else:
ml.qty_done = 0.0
ml.quantity = 0.0
return res

Check warning on line 63 in mrp_production_quant_manual_assign/wizards/assign_manual_quants.py

View check run for this annotation

Codecov / codecov/patch

mrp_production_quant_manual_assign/wizards/assign_manual_quants.py#L62-L63

Added lines #L62 - L63 were not covered by tests


class AssignManualQuantsLines(models.TransientModel):
_inherit = "assign.manual.quants.lines"

to_consume_now = fields.Boolean()
qty_done = fields.Float(digits="Product Unit of Measure", readonly=True)
quantity = fields.Float(digits="Product Unit of Measure", readonly=True)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<field name="selected" position="after">
<field
name="to_consume_now"
attrs="{'column_invisible': [('parent.is_production_single_lot', '=', False)]}"
column_invisible="not parent.is_production_single_lot"
/>
</field>
<field name="move_id" position="after">
Expand Down

0 comments on commit 36f4313

Please sign in to comment.