Skip to content

Commit

Permalink
[14.0][IMP] custom_mrp_descarga: Change reader function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Berezi committed Jan 16, 2025
1 parent 569b401 commit 1f68a4a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion custom_mrp_descarga/models/stock_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ class StockMoveLine(models.Model):
)
average_price = fields.Float(string="Average Price", related="lot_id.average_price")

@api.depends(
"product_id", "picking_type_use_create_lots", "lot_id.expiration_date", "reader"
)
def _compute_expiration_date(self):
for move_line in self:
if (
move_line.reader
and len(move_line.reader) == 44
and move_line.reader[16] == "1"
and (move_line.reader[17]) == "5"
):
return True
else:
return super()._compute_expiration_date()

@api.depends("production_id")
def _compute_sequence(self):
for line in self:
Expand Down Expand Up @@ -120,11 +135,15 @@ def reader_44_15(self, reader):
)
self.write(
{
"expiration_date": expiration_date,
"qty_done": qty_done,
"lot_id": lot.id,
}
)
self.write(
{
"expiration_date": expiration_date,
}
)

def reader_46_31(self, reader):
self.ensure_one()
Expand Down

0 comments on commit 1f68a4a

Please sign in to comment.