/usr/lib/python3/dist-packages/trytond/modules/production_work/routing.py is in tryton-modules-production-work 4.6.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import PoolMeta, Pool
from trytond.model import fields
__all__ = ['Operation', 'RoutingStep']
class Operation(metaclass=PoolMeta):
__name__ = 'production.routing.operation'
work_center_category = fields.Many2One('production.work.center.category',
'Work Center Category')
class RoutingStep(metaclass=PoolMeta):
__name__ = 'production.routing.step'
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)
else:
work.work_center = production.work_center
return work
|