Skip to content
Snippets Groups Projects
Commit 2009c99e authored by jordan's avatar jordan
Browse files

[fix] bug on compute expiration_date in stock_move_line because of specific compute from lot_id

parent 658c0221
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ from . import res_company
from . import res_config_settings
from . import sale_order
from . import stock_move
from . import stock_move_line
from . import stock_picking
from . import stock_production_lot
from . import stock_quant
# Copyright 2021 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, api
class StockMoveLine(models.Model):
_inherit = 'stock.move.line'
@api.depends('product_id', 'picking_type_use_create_lots')
def _compute_expiration_date(self):
"""
We need to overide this compute to get expiration_date compute in
lot_id instead of basic calcul made by odoo
"""
for move_line in self:
if move_line.lot_id:
move_line.expiration_date = move_line.lot_id.expiration_date
else:
super(StockMoveLine, self)._compute_expiration_date()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment