连接跳转
This commit is contained in:
@@ -16,8 +16,9 @@ class SFMessageStockPicking(models.Model):
|
|||||||
@api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id')
|
@api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id')
|
||||||
def _compute_state(self):
|
def _compute_state(self):
|
||||||
super(SFMessageStockPicking, self)._compute_state()
|
super(SFMessageStockPicking, self)._compute_state()
|
||||||
if self.state == 'assigned' and self.check_in == 'PC':
|
for record in self:
|
||||||
self.add_queue('坯料发料提醒')
|
if record.state == 'assigned' and record.check_in == 'PC':
|
||||||
|
record.add_queue('坯料发料提醒')
|
||||||
|
|
||||||
def _get_message(self, message_queue_ids):
|
def _get_message(self, message_queue_ids):
|
||||||
contents = []
|
contents = []
|
||||||
@@ -37,8 +38,9 @@ class SFMessageStockPicking(models.Model):
|
|||||||
if picking_id.state == 'assigned' and picking_id.check_in == 'PC':
|
if picking_id.state == 'assigned' and picking_id.check_in == 'PC':
|
||||||
i += 1
|
i += 1
|
||||||
if i > 0 and mrp_production_info.product_id.id not in product_id:
|
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(
|
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)
|
product_id.append(mrp_production_info.product_id.id)
|
||||||
contents.append(content)
|
contents.append(content)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -22,9 +22,12 @@ class SFMessageWork(models.Model):
|
|||||||
[('product_id', '=', mrp_workorder_line.product_id.id), ('state', '=', 'ready'),
|
[('product_id', '=', mrp_workorder_line.product_id.id), ('state', '=', 'ready'),
|
||||||
('routing_type', '=', '装夹预调')])
|
('routing_type', '=', '装夹预调')])
|
||||||
if len(mrp_workorder_list) > 0 and mrp_workorder_line.product_id.id not in product_id:
|
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(
|
content = content.replace('{{product_id}}', mrp_workorder_line.product_id.name).replace(
|
||||||
'{{number}}', str(len(mrp_workorder_list))).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)
|
product_id.append(mrp_workorder_line.product_id.id)
|
||||||
contents.append(content)
|
contents.append(content)
|
||||||
return contents
|
return contents
|
||||||
|
|||||||
Reference in New Issue
Block a user