# file: models/stock_warehouse_orderpoint.py

from odoo import models, fields, api

class StockWarehouseOrderpoint(models.Model):
    _inherit = 'stock.warehouse.orderpoint'

    last_mo_source = fields.Char(string="Source", compute='_compute_last_mo_source', store=False)

    @api.depends('product_id')
    def _compute_last_mo_source(self):
        for record in self:
            mo = self.env['mrp.production'].search(
                [('origin', 'ilike', record.name)],
                order='id desc',
                limit=1
            )
            record.last_mo_source = mo.name or ''
