Accept Merge Request #1668: (feature/消息提醒优化 -> develop)
Merge Request: 提示优化 Created By: @管欢 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @管欢 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1668?initial=true
This commit is contained in:
@@ -1618,6 +1618,26 @@ class MrpProduction(models.Model):
|
||||
})
|
||||
return action
|
||||
|
||||
def _subcontract_sanity_check(self):
|
||||
for production in self:
|
||||
if production.product_tracking != 'none' and not self.lot_producing_id:
|
||||
raise UserError(_('You must enter a serial number for %s') % production.product_id.name)
|
||||
for sml in production.move_raw_ids.move_line_ids:
|
||||
if sml.tracking != 'none' and not sml.lot_id:
|
||||
picking_ids = production.picking_ids.filtered(
|
||||
lambda p: p.state not in ['done', 'cancel'])
|
||||
picking_num = len(picking_ids)
|
||||
picking_info = ', '.join(
|
||||
['%s:%s' % (picking.picking_type_id.name, picking.name) for picking in picking_ids]
|
||||
)
|
||||
if picking_info:
|
||||
raise UserError(_('您有%s补给未完成: %s') % (
|
||||
picking_num, picking_info))
|
||||
else:
|
||||
raise UserError(
|
||||
_('您必须为以下各%s行输入序列号') % sml.product_id.display_name)
|
||||
return True
|
||||
|
||||
|
||||
class sf_detection_result(models.Model):
|
||||
_name = 'sf.detection.result'
|
||||
|
||||
Reference in New Issue
Block a user