[IMP] quality_control_stock, quality_control_mrp: set correct qty to tests

This commit is contained in:
agaldona
2017-04-11 12:18:22 +02:00
committed by Carlos Roca
parent b08e877c69
commit e2e611f06d

View File

@@ -8,6 +8,15 @@ from openerp import models, fields, api
class QcInspection(models.Model):
_inherit = 'qc.inspection'
@api.multi
def _prepare_inspection_header(self, object_ref, trigger_line):
res = super(QcInspection, self)._prepare_inspection_header(
object_ref, trigger_line)
# Fill qty when coming from pack operations
if object_ref and object_ref._name == 'mrp.production':
res['qty'] = object_ref.product_qty
return res
@api.depends('object_id')
def get_production(self):
for inspection in self: