Accept Merge Request #1420: (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/1420?initial=true
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import re
|
||||
from odoo import models, fields, api, _
|
||||
from urllib.parse import urlencode
|
||||
@@ -35,19 +36,20 @@ class SFMessageMrpProduction(models.Model):
|
||||
[('origin', '=', mrp_production.origin), ('picking_type_id.sequence_code', '=', 'SFP'),
|
||||
('state', '=', 'assigned')], limit=1)
|
||||
if stock_picking_sfp:
|
||||
url = self.request_url()
|
||||
url = self.request_url(stock_picking_sfp.id)
|
||||
content = content.replace('{{name}}', stock_picking_sfp.name).replace(
|
||||
'{{sale_order_name}}', mrp_production.origin).replace('{{request_url}}', url)
|
||||
contents.append(content)
|
||||
logging.info('生产完工入库提醒: %s' % contents)
|
||||
return contents
|
||||
|
||||
def request_url(self):
|
||||
def request_url(self, id):
|
||||
url = self.env['ir.config_parameter'].get_param('web.base.url')
|
||||
action_id = self.env.ref('mrp.mrp_production_action').id
|
||||
action_id = self.env.ref('stock.action_picking_tree_all').id
|
||||
menu_id = self.env['ir.model.data'].search([('name', '=', 'module_theme_treehouse')]).id
|
||||
# 查询参数
|
||||
params = {'menu_id': menu_id, 'action': action_id, 'model': 'mrp.production',
|
||||
'view_type': 'kanban'}
|
||||
params = {'id': id, 'menu_id': menu_id, 'action': action_id, 'model': 'mrp.production',
|
||||
'view_type': 'form'}
|
||||
# 拼接查询参数
|
||||
query_string = urlencode(params)
|
||||
# 拼接URL
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import re
|
||||
from odoo import models, fields, api, _
|
||||
from urllib.parse import urlencode
|
||||
@@ -40,9 +41,10 @@ class SFMessageStockPicking(models.Model):
|
||||
('picking_type_id.sequence_code', '=', 'OUT')])
|
||||
if stock_picking_out and len(stock_picking_out) > 0:
|
||||
content = message_queue_id.message_template_id.content
|
||||
url = self.request_url()
|
||||
url = self.request_url1(stock_picking_out.id)
|
||||
content = content.replace('{{name}}', stock_picking_out.name).replace(
|
||||
'{{sale_order_name}}', stock_picking_out.origin).replace('{{request_url}}', url)
|
||||
logging.info('订单发货提醒: %s' % content)
|
||||
return content
|
||||
|
||||
def _get_message(self, message_queue_ids):
|
||||
@@ -96,3 +98,16 @@ class SFMessageStockPicking(models.Model):
|
||||
# 拼接URL
|
||||
full_url = url + "/web#" + query_string
|
||||
return full_url
|
||||
|
||||
def request_url1(self, id):
|
||||
url = self.env['ir.config_parameter'].get_param('web.base.url')
|
||||
action_id = self.env.ref('stock.action_picking_tree_all').id
|
||||
menu_id = self.env['ir.model.data'].search([('name', '=', 'module_theme_treehouse')]).id
|
||||
# 查询参数
|
||||
params = {'id': id, 'menu_id': menu_id, 'action': action_id, 'model': 'stock.picking',
|
||||
'view_type': 'form'}
|
||||
# 拼接查询参数
|
||||
query_string = urlencode(params)
|
||||
# 拼接URL
|
||||
full_url = url + "/web#" + query_string
|
||||
return full_url
|
||||
|
||||
Reference in New Issue
Block a user