代码规范整理,产品页面模型和胚料的模型类型字段做显示
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import fields, models, api
|
||||
from odoo import models
|
||||
import time
|
||||
import hashlib
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class Common(models.Model):
|
||||
_name = 'sf.sync.common'
|
||||
_description = u'公用类'
|
||||
|
||||
|
||||
|
||||
def get_headers(self,token, secret_key):
|
||||
'''
|
||||
获取requests中的heardes参数
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from datetime import datetime
|
||||
|
||||
import requests
|
||||
import json
|
||||
from odoo import fields, models, api
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.http import request
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import fields, models, api
|
||||
from odoo import fields, models
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class Sf_Bf_Connect(http.Controller):
|
||||
cors="*")
|
||||
def get_bfm_process_order_list(self, **kw):
|
||||
"""
|
||||
获取业务平台传送来的订单
|
||||
接收业务平台加工订单分配工厂时传送来的订单数据并生成销售订单和产品及胚料
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from odoo import api, fields, models
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResMrpWorkOrder(models.Model):
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
<field name="invoice_policy" position="after">
|
||||
<field name='categ_type' invisible="1"/>
|
||||
<field name="model_file" widget="model_viewer"
|
||||
attrs="{'invisible': [('categ_type', '!=', '成品')]}"/>
|
||||
attrs="{'invisible': ['|', ('categ_type', '!=', '成品'),('categ_type', '=', False)]}"/>
|
||||
<field name="embryo_model_type_id" string="模型类型"
|
||||
attrs="{'invisible': [('categ_type', '!=', '胚料')]}"/>
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '胚料'),('categ_type', '=', False)]}"/>
|
||||
<field name="materials_id" string="材料"/>
|
||||
<field name="materials_type_id" string="型号"
|
||||
domain="[('materials_id', '=', materials_id)]"/>
|
||||
|
||||
@@ -469,6 +469,7 @@ class CNCprocessing(models.Model):
|
||||
cnc_workorder.time_ids.date_end = datetime.now()
|
||||
cnc_workorder.button_finish()
|
||||
|
||||
# 根据程序名和加工面匹配到ftp里对应的Nc程序名
|
||||
def get_cnc_processing_file(self, folder_name, cnc_processing, processing_panel):
|
||||
logging.info('folder_name:%s' % folder_name)
|
||||
serverdir = os.path.join('/tmp', folder_name, 'return', processing_panel)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import SUPERUSER_ID, _, api, fields, models, registry
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class Users(models.Model):
|
||||
_inherit = 'res.users'
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from collections import defaultdict, namedtuple
|
||||
from odoo.addons.stock.models.stock_rule import ProcurementException
|
||||
from re import findall as regex_findall
|
||||
from re import split as regex_split
|
||||
from odoo import SUPERUSER_ID, _, api, fields, models, registry
|
||||
from odoo.tools import float_compare, float_is_zero, html_escape
|
||||
from odoo import SUPERUSER_ID, _, api, models
|
||||
from odoo.tools import float_compare
|
||||
|
||||
|
||||
class StockRule(models.Model):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Part of SmartGo. See LICENSE file for full copyright and licensing details.
|
||||
import base64
|
||||
from io import BytesIO
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
from odoo import api, fields, models
|
||||
from pystrich.code128 import Code128Encoder
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import posixpath
|
||||
from odoo.modules import get_resource_path
|
||||
from ftplib import FTP
|
||||
import logging
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of SmartGo. See LICENSE file for full copyright and licensing details.
|
||||
import logging
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import requests
|
||||
import json
|
||||
import base64
|
||||
from odoo import models
|
||||
from odoo.exceptions import ValidationError
|
||||
import logging
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
|
||||
from odoo.http import request
|
||||
from .res_config_setting import ResConfigSettings
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user