连接跳转

This commit is contained in:
guanhuan
2024-09-24 16:23:45 +08:00
parent b986dd8473
commit 7a8753408b
2 changed files with 9 additions and 4 deletions

View File

@@ -16,8 +16,9 @@ class SFMessageStockPicking(models.Model):
@api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id')
def _compute_state(self):
super(SFMessageStockPicking, self)._compute_state()
if self.state == 'assigned' and self.check_in == 'PC':
self.add_queue('坯料发料提醒')
for record in self:
if record.state == 'assigned' and record.check_in == 'PC':
record.add_queue('坯料发料提醒')
def _get_message(self, message_queue_ids):
contents = []
@@ -37,8 +38,9 @@ class SFMessageStockPicking(models.Model):
if picking_id.state == 'assigned' and picking_id.check_in == 'PC':
i += 1
if i > 0 and mrp_production_info.product_id.id not in product_id:
url = message_queue_id.message_template_id.get_url(int(message_queue_id.res_id))
content = content.replace('{{product_id}}', mrp_production_info.product_id.name).replace(
'{{number}}', str(i))
'{{number}}', str(i)).replace('{{request_url}}', url)
product_id.append(mrp_production_info.product_id.id)
contents.append(content)
else:

View File

@@ -22,9 +22,12 @@ class SFMessageWork(models.Model):
[('product_id', '=', mrp_workorder_line.product_id.id), ('state', '=', 'ready'),
('routing_type', '=', '装夹预调')])
if len(mrp_workorder_list) > 0 and mrp_workorder_line.product_id.id not in product_id:
url = message_queue_id.message_template_id.get_url(int(message_queue_id.res_id)) + "&active_id=1"
content = content.replace('{{product_id}}', mrp_workorder_line.product_id.name).replace(
'{{number}}', str(len(mrp_workorder_list))).replace(
'{{part_number}}', mrp_workorder_line.part_number if mrp_workorder_line.part_number else "")
'{{part_number}}',
mrp_workorder_line.part_number if mrp_workorder_line.part_number else "").replace(
'{{request_url}}', url)
product_id.append(mrp_workorder_line.product_id.id)
contents.append(content)
return contents