优化代码格式
This commit is contained in:
@@ -19,5 +19,3 @@ class Common(models.Model):
|
||||
'TIMESTAMP': str(timestamp),
|
||||
'checkstr': check_sf_str}
|
||||
return headers
|
||||
|
||||
|
||||
|
||||
@@ -4,9 +4,3 @@ from . import tool_base_new
|
||||
from . import fixture
|
||||
from . import functional_fixture
|
||||
from . import tool_other_features
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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 = '供应商排序'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
from . import controllers
|
||||
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
from . import models
|
||||
|
||||
|
||||
@@ -1,7 +1,2 @@
|
||||
# from . import product_template
|
||||
# from . import product_supplierinfo
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
@@ -1,13 +1,12 @@
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
import os
|
||||
import base64
|
||||
import math
|
||||
import requests
|
||||
import logging
|
||||
# import subprocess
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.addons.sf_mrs_connect.models.ftp_operate import FtpController
|
||||
@@ -388,7 +387,8 @@ class ResMrpWorkOrder(models.Model):
|
||||
productions._create_workorder()
|
||||
productions.filtered(lambda p: (not p.orderpoint_id and p.move_raw_ids) or \
|
||||
(
|
||||
p.move_dest_ids.procure_method != 'make_to_order' and not p.move_raw_ids and not p.workorder_ids)).action_confirm()
|
||||
p.move_dest_ids.procure_method != 'make_to_order' and
|
||||
not p.move_raw_ids and not p.workorder_ids)).action_confirm()
|
||||
|
||||
for production in productions:
|
||||
origin_production = production.move_dest_ids and production.move_dest_ids[
|
||||
|
||||
Reference in New Issue
Block a user