From 339c40abe1b6c99d0b5ee4ff47b2c92d9ac5a987 Mon Sep 17 00:00:00 2001 From: svs-odoo Date: Fri, 14 Feb 2020 09:35:16 +0000 Subject: [PATCH] [IMP] stock: inventory line product_qty readonly Moves the readonly condition for the `product_qty` field into the model to have the same condition in the barcode app (enterprise). task-2123726 --- addons/stock/models/stock_inventory.py | 1 + addons/stock/views/stock_inventory_views.xml | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py index 056fa55778e..96698fdd5b3 100644 --- a/addons/stock/models/stock_inventory.py +++ b/addons/stock/models/stock_inventory.py @@ -341,6 +341,7 @@ class InventoryLine(models.Model): required=True, readonly=True) product_qty = fields.Float( 'Counted Quantity', + readonly=True, states={'confirm': [('readonly', False)]}, digits='Product Unit of Measure', default=0) categ_id = fields.Many2one(related='product_id.categ_id', store=True) location_id = fields.Many2one( diff --git a/addons/stock/views/stock_inventory_views.xml b/addons/stock/views/stock_inventory_views.xml index 2ce0ec22f55..b7b527c063e 100644 --- a/addons/stock/views/stock_inventory_views.xml +++ b/addons/stock/views/stock_inventory_views.xml @@ -46,8 +46,7 @@