mirror of
https://github.com/bringout/oca-ocb-mrp.git
synced 2026-04-27 12:32:03 +02:00
19.0 vanilla
This commit is contained in:
parent
accf5918df
commit
6e65e8c877
688 changed files with 225434 additions and 199401 deletions
|
|
@ -4,9 +4,21 @@
|
|||
from odoo import api, models
|
||||
|
||||
|
||||
class ReportBomStructure(models.AbstractModel):
|
||||
class ReportMrpReport_Bom_Structure(models.AbstractModel):
|
||||
_inherit = 'report.mrp.report_bom_structure'
|
||||
|
||||
@api.model
|
||||
def _is_buy_route(self, rules, product, bom):
|
||||
return super()._is_buy_route(rules, product, bom) and (not bom or bom.type != 'subcontract')
|
||||
|
||||
@api.model
|
||||
def _get_resupply_availability(self, route_info, components):
|
||||
resupply_state, resupply_delay = super()._get_resupply_availability(route_info, components)
|
||||
if route_info.get('route_type') == 'subcontract' and resupply_delay:
|
||||
# always add `Days to Purchase`
|
||||
extra_delay = route_info['bom'].company_id.days_to_purchase
|
||||
route_info['lead_time'] += extra_delay
|
||||
route_info['manufacture_delay'] += extra_delay
|
||||
subcontract_delay = resupply_delay + extra_delay
|
||||
return ('estimated', subcontract_delay)
|
||||
return (resupply_state, resupply_delay)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue