mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_hook: Provide hooks for _bom_explode method
As we are struggled by the structure of core current code, and https://github.com/odoo/odoo/pull/8885 hasn't been accepted in v8, we need to make this hard move to allow a lot of workarounds like modules not depending this one, but anyway the method itself is not too much inheritable.
This commit is contained in:
committed by
Andhitia Rama
parent
c90d52c863
commit
48d327b8ce
@@ -1,5 +1,4 @@
|
||||
|
||||
# -*- encoding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -19,7 +18,7 @@
|
||||
|
||||
{
|
||||
'name': 'MRP Operations start without material',
|
||||
'version': '1.0',
|
||||
'version': '8.0.1.0.1',
|
||||
'author': 'OdooMRP team',
|
||||
'contributors': ["Daniel Campos <danielcampos@avanzosc.es>",
|
||||
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
|
||||
|
||||
@@ -3,20 +3,15 @@
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
|
||||
from openerp import models
|
||||
from openerp import models, api
|
||||
|
||||
|
||||
class MrpBom(models.Model):
|
||||
_inherit = 'mrp.bom'
|
||||
|
||||
def _get_workorder_operations(self, result2, factor, level=0,
|
||||
routing_id=False):
|
||||
res = super(MrpBom, self)._get_workorder_operations(
|
||||
result2, factor, level, routing_id)
|
||||
for work_order in res:
|
||||
seq = work_order['sequence'] - level
|
||||
rl = self._get_routing_line_from_workorder(
|
||||
routing_id, seq, work_order['workcenter_id'],
|
||||
work_order['name'])
|
||||
work_order['init_without_material'] = rl.init_without_material
|
||||
@api.multi
|
||||
def _prepare_wc_line(self, wc_use, level=0, factor=1):
|
||||
res = super(MrpBom, self)._prepare_wc_line(
|
||||
wc_use, level=level, factor=factor)
|
||||
res['init_without_material'] = wc_use.init_without_material
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user