[MIG] rma_sale_mrp: Migration to 16.0

This commit is contained in:
AlexPForgeFlow
2023-08-23 17:33:46 +02:00
committed by Aaron ForgeFlow
parent 1945fc2080
commit fd13872a81
2 changed files with 12 additions and 14 deletions

View File

@@ -3,7 +3,7 @@
{ {
"name": "RMA Manufacturing Integration", "name": "RMA Manufacturing Integration",
"version": "14.0.1.1.0", "version": "16.0.1.0.0",
"license": "LGPL-3", "license": "LGPL-3",
"category": "RMA", "category": "RMA",
"summary": "Integrates RMA with Kit Manufacturing/Sale Process", "summary": "Integrates RMA with Kit Manufacturing/Sale Process",

View File

@@ -112,7 +112,7 @@ class TestRmaMrp(TransactionCase):
"picking_type_id": self.stock_picking_type_in.id, "picking_type_id": self.stock_picking_type_in.id,
"location_id": self.stock_location_supplier_id.id, "location_id": self.stock_location_supplier_id.id,
"location_dest_id": self.stock_location_id.id, "location_dest_id": self.stock_location_id.id,
"move_lines": [ "move_ids": [
( (
0, 0,
0, 0,
@@ -135,7 +135,7 @@ class TestRmaMrp(TransactionCase):
"""Do picking with only one move on the given date.""" """Do picking with only one move on the given date."""
picking.action_confirm() picking.action_confirm()
picking.action_assign() picking.action_assign()
picking.move_lines.quantity_done = qty picking.move_ids.quantity_done = qty
res = picking.button_validate() res = picking.button_validate()
if isinstance(res, dict) and res: if isinstance(res, dict) and res:
backorder_wiz_id = res["res_id"] backorder_wiz_id = res["res_id"]
@@ -158,18 +158,16 @@ class TestRmaMrp(TransactionCase):
def _receive_rma(self, rma_line_ids): def _receive_rma(self, rma_line_ids):
wizard = self.rma_make_picking.with_context( wizard = self.rma_make_picking.with_context(
{ active_ids=rma_line_ids.ids,
"active_ids": rma_line_ids.ids, active_model="rma.order.line",
"active_model": "rma.order.line", picking_type="incoming",
"picking_type": "incoming", active_id=1,
"active_id": 1,
}
).create({}) ).create({})
wizard._create_picking() wizard._create_picking()
pickings = rma_line_ids._get_in_pickings() pickings = rma_line_ids._get_in_pickings()
pickings.action_assign() pickings.action_assign()
for picking in pickings: for picking in pickings:
for mv in picking.move_lines: for mv in picking.move_ids:
mv.quantity_done = mv.product_uom_qty mv.quantity_done = mv.product_uom_qty
# In case of two step pickings, ship in two steps: # In case of two step pickings, ship in two steps:
while pickings.filtered(lambda p: p.state == "assigned"): while pickings.filtered(lambda p: p.state == "assigned"):
@@ -211,10 +209,10 @@ class TestRmaMrp(TransactionCase):
order_01.order_line, order_01.order_line.price_unit order_01.order_line, order_01.order_line.price_unit
) )
component_1_sm = rma_picking_01.move_lines.filtered( component_1_sm = rma_picking_01.move_ids.filtered(
lambda x: x.product_id == self.component_product_1 lambda x: x.product_id == self.component_product_1
) )
component_2_sm = rma_picking_01.move_lines.filtered( component_2_sm = rma_picking_01.move_ids.filtered(
lambda x: x.product_id == self.component_product_2 lambda x: x.product_id == self.component_product_2
) )
@@ -235,10 +233,10 @@ class TestRmaMrp(TransactionCase):
order_02.order_line, order_02.order_line.price_unit order_02.order_line, order_02.order_line.price_unit
) )
component_1_sm = rma_picking_02.move_lines.filtered( component_1_sm = rma_picking_02.move_ids.filtered(
lambda x: x.product_id == self.component_product_1 lambda x: x.product_id == self.component_product_1
) )
component_2_sm = rma_picking_02.move_lines.filtered( component_2_sm = rma_picking_02.move_ids.filtered(
lambda x: x.product_id == self.component_product_2 lambda x: x.product_id == self.component_product_2
) )