Add routing as Lead Time parameter
issue5560 review27291002
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
* Add routing as Lead Time parameter
|
||||
|
||||
Version 4.0.0 - 2016-05-02
|
||||
* Initial release
|
||||
* Initial release
|
||||
|
||||
@@ -15,4 +15,5 @@ def register():
|
||||
Routing_BOM,
|
||||
Production,
|
||||
ProductBom,
|
||||
ProductionLeadTime,
|
||||
module='production_routing', type_='model')
|
||||
|
||||
+12
-1
@@ -4,7 +4,7 @@ from trytond.pool import PoolMeta
|
||||
from trytond.model import fields
|
||||
from trytond.pyson import Eval
|
||||
|
||||
__all__ = ['ProductBom']
|
||||
__all__ = ['ProductBom', 'ProductionLeadTime']
|
||||
|
||||
|
||||
class ProductBom:
|
||||
@@ -16,3 +16,14 @@ class ProductBom:
|
||||
('boms', '=', Eval('bom', 0)),
|
||||
],
|
||||
depends=['bom'])
|
||||
|
||||
|
||||
class ProductionLeadTime:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'production.lead_time'
|
||||
routing = fields.Many2One('production.routing', 'Routing',
|
||||
ondelete='CASCADE',
|
||||
domain=[
|
||||
('boms', '=', Eval('bom', 0)),
|
||||
],
|
||||
depends=['bom'])
|
||||
|
||||
+23
@@ -21,5 +21,28 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="inherit" ref="production.product-bom_view_form"/>
|
||||
<field name="name">product_bom_form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="production_lead_time_view_list">
|
||||
<field name="model">production.lead_time</field>
|
||||
<field name="inherit"
|
||||
ref="production.production_lead_time_view_list"/>
|
||||
<field name="name">production_lead_time_list</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view"
|
||||
id="production_lead_time_view_list_sequence">
|
||||
<field name="model">production.lead_time</field>
|
||||
<field name="inherit"
|
||||
ref="production.production_lead_time_view_list_sequence"/>
|
||||
<field name="name">production_lead_time_list_sequence</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="production_lead_time_view_form">
|
||||
<field name="model">production.lead_time</field>
|
||||
<field name="inherit"
|
||||
ref="production.production_lead_time_view_form"/>
|
||||
<field name="name">production_lead_time_form</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</tryton>
|
||||
|
||||
@@ -30,6 +30,15 @@ class Production:
|
||||
else:
|
||||
self.routing = None
|
||||
|
||||
@fields.depends('routing')
|
||||
def on_change_with_planned_start_date(self, pattern=None):
|
||||
if pattern is None:
|
||||
pattern = {}
|
||||
pattern.setdefault(
|
||||
'routing', self.routing.id if self.routing else None)
|
||||
return super(Production, self).on_change_with_planned_start_date(
|
||||
pattern=pattern)
|
||||
|
||||
@classmethod
|
||||
def compute_request(cls, product, warehouse, quantity, date, company):
|
||||
production = super(Production, cls).compute_request(
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/field[@name='bom']" position="after">
|
||||
<label name="routing"/>
|
||||
<field name="routing" widget="selection"/>
|
||||
</xpath>
|
||||
</data>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/tree/field[@name='bom']" position="after">
|
||||
<field name="routing"/>
|
||||
</xpath>
|
||||
</data>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/tree/field[@name='bom']" position="after">
|
||||
<field name="routing" widget="selection"/>
|
||||
</xpath>
|
||||
</data>
|
||||
Reference in New Issue
Block a user