[FIX] stock: fix move line without state

When the "Show Detailed Operations" is enabled on a picking type,
create a immediate transfers with it, validate, unlock and readd
a new detailed operation, save and it will create a move line without
any state. Due this lack of state, the quant won't be updated.

Fix by remove the readonly=False in the state fields
(3f4f77fd9d), to avoid sending
state:False by the web client.

closes odoo/odoo#44425

X-original-commit: 8f28b302e6311322abc749daf364d4c1c5398fe6
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
Rémy Voet (ryv)
2020-01-31 17:18:01 +00:00
parent cf2f53e4cf
commit 86771472fd
+1 -1
View File
@@ -56,7 +56,7 @@ class StockMoveLine(models.Model):
picking_code = fields.Selection(related='picking_id.picking_type_id.code', readonly=True)
picking_type_use_create_lots = fields.Boolean(related='picking_id.picking_type_id.use_create_lots', readonly=True)
picking_type_use_existing_lots = fields.Boolean(related='picking_id.picking_type_id.use_existing_lots', readonly=True)
state = fields.Selection(related='move_id.state', store=True, related_sudo=False, readonly=False)
state = fields.Selection(related='move_id.state', store=True, related_sudo=False)
is_initial_demand_editable = fields.Boolean(related='move_id.is_initial_demand_editable', readonly=False)
is_locked = fields.Boolean(related='move_id.is_locked', default=True, readonly=True)
consume_line_ids = fields.Many2many('stock.move.line', 'stock_move_line_consume_rel', 'consume_line_id', 'produce_line_id', help="Technical link to see who consumed what. ")