1.新增加工面模型2.制造订单详情页面的返工操作上的加工面根据产品的加工面板进行过滤
This commit is contained in:
@@ -691,7 +691,17 @@ class MrpProduction(models.Model):
|
||||
|
||||
# 返工
|
||||
def button_rework(self):
|
||||
return True
|
||||
return {
|
||||
'name': _('返工'),
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'sf.rework.wizard',
|
||||
'target': 'new',
|
||||
'context': {
|
||||
'default_production_id': [(6, 0, [self.id])],
|
||||
'default_product_id': self.product_id.id
|
||||
}
|
||||
}
|
||||
|
||||
# 报废
|
||||
def button_scrap_new(self):
|
||||
@@ -733,3 +743,26 @@ class sf_detection_result(models.Model):
|
||||
# },
|
||||
'target': 'new'
|
||||
}
|
||||
|
||||
|
||||
class sf_processing_panel(models.Model):
|
||||
_name = 'sf.processing.panel'
|
||||
_description = "加工面"
|
||||
|
||||
name = fields.Char('加工面')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
# @api.model
|
||||
# def name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
|
||||
# if self.env.user.has_group('sf_base.group_sf_order_user'):
|
||||
# if self._context.get('product_id'):
|
||||
# product = self.env['product.product'].search([('id', '=', self._context.get('product_id'))])
|
||||
# if product:
|
||||
# panel = self.env['sf.processing.panel'].search([('name', 'ilike', 'ZM')])
|
||||
# if panel:
|
||||
# ids = [t.id for t in panel]
|
||||
# domain = [('id', 'in', ids)]
|
||||
# else:
|
||||
# domain = [('id', '=', False)]
|
||||
# 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