合并企业版代码(未测试,先提交到测试分支)

This commit is contained in:
qihao.gong@jikimo.com
2023-04-14 17:42:23 +08:00
parent 7a7b3d7126
commit d28525526a
1300 changed files with 513579 additions and 5426 deletions

View File

@@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
import logging
from odoo import fields, models
import requests
from odoo.addons.sf_base.commons.common import Common
from urllib.parse import urlencode
_logger = logging.getLogger(__name__)
@@ -17,6 +19,41 @@ class MrsProductionMaterials(models.Model):
remark = fields.Text("备注")
active = fields.Boolean('有效', default=True)
# def open_url_action(self):
# base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
# # url = 'http://192.168.50.202:8080/api'
# url = 'https://bfw.jikimo.com/'
# # data = {
# # 'key' : 'value'
# # }
#
# response = requests.get(url)
# response.raise_for_status()
# return {
# 'type': 'ir.actions.act_url',
# 'url': response.url,
# 'target': 'new'
# }
def open_url_action(self):
# sf_sync_config = self.env['res.config.settings'].get_values()
# token = sf_sync_config['token']
# sf_secret_key = sf_sync_config['sf_secret_key']
# headers = Common.get_headers(self, token, sf_secret_key)
url = 'http://192.168.50.127:8081'
params = {
'user_id': self._uid
}
url_params = urlencode(params)
return {
'type': 'ir.actions.act_url',
'url': url + '?' + url_params,
# 'url': url,
'target': 'new'
}
# 材料型号
class MrsMaterialModel(models.Model):

View File

@@ -203,7 +203,10 @@
</group>
<group>
<field name="remark"/>
<button string="测试跳转" name="open_url_action" type="object" confirm="是否确认下发补偿"
class="btn-primary" />
<field name="remark" widget="code"/>
</group>
</form>
</field>