Skip to content

Commit

Permalink
[IMP] rma_scrap: now works with lots/serials
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidJForgeFlow authored and AaronHForgeFlow committed Sep 16, 2023
1 parent bb66616 commit fb9af9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rma_scrap/wizards/rma_make_scrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def _prepare_item(self, line):
"line_id": line.id,
"rma_id": line.rma_id and line.rma_id.id or False,
}
if line.lot_id:
values["lot_id"] = line.lot_id.id
return values

@api.model
Expand Down Expand Up @@ -73,6 +75,7 @@ def _prepare_scrap(self, item):
"name": line.rma_id.id and line.rma_id.name or line.name,
"origin": line.name,
"product_id": item.line_id.product_id.id,
"lot_id": item.lot_id.id or False,
"scrap_qty": item.qty_to_scrap,
"product_uom_id": item.line_id.product_id.product_tmpl_id.uom_id.id,
"location_id": item.location_id.id,
Expand All @@ -96,6 +99,7 @@ class RmaMakeScrapItem(models.TransientModel):
)
rma_id = fields.Many2one("rma.order", related="line_id.rma_id", string="RMA Group")
product_id = fields.Many2one("product.product", string="Product", required=True)
lot_id = fields.Many2one("stock.production.lot", string="Lot/Serial Number")
product_qty = fields.Float(
related="line_id.product_qty",
string="Quantity Ordered",
Expand Down
4 changes: 4 additions & 0 deletions rma_scrap/wizards/rma_scrap_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<tree string="RMA Lines" editable="bottom" create="false">
<field name="rma_id" groups="rma.group_rma_groups" />
<field name="product_id" />
<field
name="lot_id"
attrs="{'invisible':[('lot_id', '=', False)]}"
/>
<field name="product_qty" />
<field name="qty_to_scrap" />
<field name="location_id" />
Expand Down

0 comments on commit fb9af9b

Please sign in to comment.