2018-01-16 06:58:15 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2018-01-16 11:34:37 +01:00
|
|
|
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
|
2018-01-16 06:58:15 +01:00
|
|
|
|
2018-01-16 11:34:37 +01:00
|
|
|
from flectra import api, fields, models
|
2018-01-16 06:58:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
class StockQuant(models.Model):
|
|
|
|
_inherit = 'stock.quant'
|
|
|
|
|
|
|
|
removal_date = fields.Datetime(related='lot_id.removal_date', store=True)
|
|
|
|
|
|
|
|
@api.model
|
|
|
|
def _get_removal_strategy_order(self, removal_strategy):
|
|
|
|
if removal_strategy == 'fefo':
|
|
|
|
return 'removal_date, in_date, id'
|
|
|
|
return super(StockQuant, self)._get_removal_strategy_order(removal_strategy)
|