class SaleOrder(models.Model):
_inherit = "sale.order"
...
picking_state = fields.Selection(string="Picking State", related="picking_id.state")
# this are a states from "stock.picking" model
warehouse_id = fields.Many2one(
'stock.warehouse', string='Warehouse',
required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
default=_default_warehouse_id)
# at the moment the "readonly" of warehouse_id depends on states from "sale.order"
How to include condition: readonly=True when picking_state == "done" ?