优化代码格式

This commit is contained in:
jinling.yang
2023-11-23 17:38:30 +08:00
parent 45d04e1a05
commit e9be2e9c43
9 changed files with 12 additions and 50 deletions

View File

@@ -4,9 +4,3 @@ from . import tool_base_new
from . import fixture
from . import functional_fixture
from . import tool_other_features

View File

@@ -17,29 +17,7 @@ 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
@@ -82,7 +60,6 @@ class MrsMaterialModel(models.Model):
active = fields.Boolean('有效', default=True)
class MrsProductionProcessCategory(models.Model):
_name = 'sf.production.process.category'
_description = '表面工艺类别'
@@ -131,6 +108,7 @@ class MrsProcessingOrder(models.Model):
index=True, string='加工工艺')
production_process_id = fields.Many2one('sf.production.process', string="表面工艺")
class SupplierSort(models.Model):
_name = 'sf.supplier.sort'
_description = '供应商排序'

View File

@@ -1,5 +1,5 @@
import requests
import json
import requests
from odoo import models, fields, api
from odoo.addons.sf_base.commons.common import Common
from odoo.exceptions import ValidationError