Skip to content
Extraits de code Groupes Projets
Valider 2009c99e rédigé par jordan's avatar jordan
Parcourir les fichiers

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

parent 658c0221
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -7,6 +7,7 @@ from . import res_company ...@@ -7,6 +7,7 @@ from . import res_company
from . import res_config_settings from . import res_config_settings
from . import sale_order from . import sale_order
from . import stock_move from . import stock_move
from . import stock_move_line
from . import stock_picking from . import stock_picking
from . import stock_production_lot from . import stock_production_lot
from . import stock_quant 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% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter