[FIX] error raise if the manufacturing order produce in more than 1 move.

This commit is contained in:
Jordi Riera
2015-04-01 13:12:39 -04:00
parent de4f9d69b2
commit 342e0f567b
2 changed files with 10 additions and 8 deletions

View File

@@ -22,7 +22,7 @@
{
'name': 'Bill of Material Selection Reference',
'version': '1.0',
'version': '1.1',
'author': 'Savoir-faire Linux',
'license': 'AGPL-3',
'category': 'Others',

View File

@@ -20,18 +20,19 @@
#
##############################################################################
import logging
from openerp import models, api
_logger = logging.getLogger(__name__)
class MrpProduction(models.Model):
_inherit = 'mrp.production'
@api.model
def action_produce(
self, production_id, production_qty, production_mode, wiz=False
):
"""
Affect the Bill of Material to each serial number related to
def action_produce(self, production_id, production_qty,
production_mode, wiz=False):
"""Affect the Bill of Material to each serial number related to
the produced stocks
"""
res = super(MrpProduction, self).action_produce(
@@ -39,7 +40,8 @@ class MrpProduction(models.Model):
production = self.browse(production_id)
prod_lots = production.move_created_ids2.lot_ids
prod_lots.write({'bom_id': production.bom_id.id})
for move in production.move_created_ids2:
prod_lots = move.lot_ids
prod_lots.write({'bom_id': production.bom_id.id})
return res