根据工序生成工单
This commit is contained in:
16
sf_manufacturing/models/sf_production_common.py
Normal file
16
sf_manufacturing/models/sf_production_common.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import fields, models, api
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class SfProductionProcessParameter(models.Model):
|
||||
_inherit = 'sf.production.process.parameter'
|
||||
|
||||
@api.model
|
||||
def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
|
||||
if self._context.get('route_id'):
|
||||
routing = self.env['mrp.routing.workcenter'].search([('id', '=', self._context.get('route_id'))])
|
||||
domain = [('process_id', '=', routing.surface_technics_id.id)]
|
||||
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
||||
return super()._name_search(name, args, operator, limit, name_get_uid)
|
||||
Reference in New Issue
Block a user