diff --git a/stock_picking_volume/models/stock_move.py b/stock_picking_volume/models/stock_move.py index 8bfce4aa7..f86b662a8 100644 --- a/stock_picking_volume/models/stock_move.py +++ b/stock_picking_volume/models/stock_move.py @@ -9,7 +9,11 @@ class StockMove(models.Model): _inherit = "stock.move" volume = fields.Float( - compute="_compute_volume", readonly=False, store=True, compute_sudo=True + compute="_compute_volume", + readonly=False, + store=True, + compute_sudo=True, + states={"done": [("readonly", True)], "cancel": [("readonly", True)]}, ) volume_uom_name = fields.Char( diff --git a/stock_picking_volume/models/stock_picking.py b/stock_picking_volume/models/stock_picking.py index 007df9cc7..483a1bde0 100644 --- a/stock_picking_volume/models/stock_picking.py +++ b/stock_picking_volume/models/stock_picking.py @@ -9,7 +9,11 @@ class StockPicking(models.Model): _inherit = "stock.picking" volume = fields.Float( - compute="_compute_volume", readonly=False, store=True, compute_sudo=True + compute="_compute_volume", + readonly=False, + store=True, + compute_sudo=True, + states={"done": [("readonly", True)], "cancel": [("readonly", True)]}, ) volume_uom_name = fields.Char( string="Volume unit of measure label", compute="_compute_volume_uom_name"