changes in RoutingStep
This commit is contained in:
parent
6ba94dcf5e
commit
a6372e7e87
|
@ -19,6 +19,7 @@ def register():
|
|||
production.ProductionCost,
|
||||
production.SubProduction,
|
||||
production.SubProductionIn,
|
||||
production.RoutingStep,
|
||||
account.Move,
|
||||
stock.Move,
|
||||
ir.Cron,
|
||||
|
|
|
@ -521,6 +521,30 @@ class ProductionCost(ModelSQL, ModelView):
|
|||
return round(self.unit_price * Decimal(self.quantity), 2)
|
||||
|
||||
|
||||
class RoutingStep(metaclass=PoolMeta):
|
||||
__name__ = 'production.routing.step'
|
||||
work_center = fields.Many2One('production.work.center', 'Work Center')
|
||||
|
||||
def get_work(self, production, work_center_picker):
|
||||
"Return work instance for the production using the work center picker"
|
||||
pool = Pool()
|
||||
Work = pool.get('production.work')
|
||||
|
||||
work = Work()
|
||||
work.sequence = self.sequence
|
||||
work.operation = self.operation
|
||||
work.production = production
|
||||
work.company = production.company
|
||||
if self.operation.work_center_category:
|
||||
work.work_center = work_center_picker(
|
||||
production.work_center, self.operation.work_center_category)
|
||||
elif self.work_center:
|
||||
work.work_center = self.work_center
|
||||
else:
|
||||
work.work_center = production.work_center
|
||||
return work
|
||||
|
||||
|
||||
class ProductionReport(CompanyReport):
|
||||
'Production Report'
|
||||
__name__ = 'production.report'
|
||||
|
|
|
@ -113,5 +113,11 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="model">production,-1</field>
|
||||
<field name="action" ref="wizard_production_force_draft"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="routing_step_view_form">
|
||||
<field name="inherit" ref="production_routing.routing_step_view_form"/>
|
||||
<field name="model">production.routing.step</field>
|
||||
<field name="name">routing_step_form</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
|
|
@ -6,6 +6,8 @@ depends:
|
|||
product
|
||||
account
|
||||
production
|
||||
production_work
|
||||
production_routing
|
||||
account_stock_latin
|
||||
analytic_account
|
||||
stock_co
|
||||
|
|
|
@ -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='sequence']" position="after">
|
||||
<label name="work_center"/>
|
||||
<field name="work_center"/>
|
||||
</xpath>
|
||||
</data>
|
Loading…
Reference in New Issue