mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[FIX] error raise if the manufacturing order produce in more than 1 move.
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user