quality_control_*: Make use of qty field

Making it a regular field, you can put any manual quantity in inspections
This commit is contained in:
Pedro M. Baeza
2015-11-14 01:53:55 +01:00
committed by Enrique Martín
parent 29fa84e1d1
commit 1a8da9c95c
3 changed files with 4 additions and 7 deletions

View File

@@ -28,11 +28,6 @@ class QcInspection(models.Model):
else:
self.product = False
@api.one
@api.depends('object_id')
def _get_qty(self):
self.qty = 1.0
name = fields.Char(
string='Inspection number', required=True, default='/', select=True,
readonly=True, states={'draft': [('readonly', False)]}, copy=False)
@@ -46,7 +41,7 @@ class QcInspection(models.Model):
product = fields.Many2one(
comodel_name="product.product", compute="_get_product", store=True,
help="Product associated with the inspection")
qty = fields.Float(string="Quantity", compute="_get_qty", store=True)
qty = fields.Float(string="Quantity", default=1.0)
test = fields.Many2one(
comodel_name='qc.test', string='Test', readonly=True, select=True)
inspection_lines = fields.One2many(