Merge branch 'feature/库存优化_6' into feature/调拨质检消息优化
This commit is contained in:
@@ -774,11 +774,11 @@ class MrpProduction(models.Model):
|
||||
self.ensure_one()
|
||||
iot_code = self.env['stock.lot']._get_next_serial(self.company_id, self.product_id) or self.env[
|
||||
'ir.sequence'].next_by_code('stock.lot.serial')
|
||||
iot_code_name = re.sub('[\u4e00-\u9fa5]', "", iot_code)
|
||||
# iot_code_name = re.sub('[\u4e00-\u9fa5]', "", iot_code)
|
||||
self.lot_producing_id = self.env['stock.lot'].create({
|
||||
'product_id': self.product_id.id,
|
||||
'company_id': self.company_id.id,
|
||||
'name': iot_code_name,
|
||||
'name': iot_code,
|
||||
})
|
||||
if self.move_finished_ids.filtered(lambda m: m.product_id == self.product_id).move_line_ids:
|
||||
self.move_finished_ids.filtered(
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
<field name="msgtype">markdown</field>
|
||||
<field name="urgency">normal</field>
|
||||
<field name="content">### {{picking_type_name}}待处理提醒:
|
||||
单号:{{name}}
|
||||
单号:[{{name}}]({{request_url}})
|
||||
事项:质量检查已完成</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -51,7 +51,8 @@ class SFMessageStockPicking(models.Model):
|
||||
all_ready_or_done = all(picking.state in ['assigned', 'done'] for picking in stock_picking_list)
|
||||
if all_ready_or_done:
|
||||
mrp_production.add_queue('工序外协发料通知')
|
||||
if all(qc.quality_state in ['pass', 'fail'] for qc in record.quality_check_ids):
|
||||
if record.quality_check_ids and all(
|
||||
qc.quality_state in ['pass', 'fail'] for qc in record.quality_check_ids):
|
||||
record.add_queue('调拨单质检完成提醒')
|
||||
except Exception as e:
|
||||
logging.info('add_queue_compute_state error:%s' % e)
|
||||
@@ -92,8 +93,12 @@ class SFMessageStockPicking(models.Model):
|
||||
content = message_queue_id.message_template_id.content
|
||||
stock_picking_line = self.env['stock.picking'].sudo().search(
|
||||
[('id', '=', int(message_queue_id.res_id))])
|
||||
url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
|
||||
action_id = self.env.ref('stock.action_picking_tree_ready').id
|
||||
menu_id = self.env.ref('stock.menu_stock_root').id
|
||||
url_with_id = f"{url}/web#view_type=form&action={action_id}&menu_id={menu_id}&id={stock_picking_line.id}"
|
||||
content = content.replace('{{picking_type_name}}', stock_picking_line.picking_type_id.name).replace(
|
||||
'{{name}}', stock_picking_line.name)
|
||||
'{{name}}', stock_picking_line.name).replace('{{request_url}}', url_with_id)
|
||||
contents.append(content)
|
||||
return contents, message_queue_ids
|
||||
|
||||
|
||||
Reference in New Issue
Block a user