mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] quality_control_stock, quality_control_mrp: set correct qty to tests
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -60,6 +60,8 @@ class QcInspection(models.Model):
|
||||
# Fill qty when coming from pack operations
|
||||
if object_ref and object_ref._name == 'stock.pack.operation':
|
||||
res['qty'] = object_ref.product_qty
|
||||
if object_ref and object_ref._name == 'stock.move':
|
||||
res['qty'] = object_ref.product_uom_qty
|
||||
return res
|
||||
|
||||
picking = fields.Many2one(
|
||||
|
||||
Reference in New Issue
Block a user