diff --git a/jikimo_account_process/__init__.py b/jikimo_account_process/__init__.py new file mode 100644 index 00000000..511a0ca3 --- /dev/null +++ b/jikimo_account_process/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import controllers +from . import models \ No newline at end of file diff --git a/jikimo_account_process/__manifest__.py b/jikimo_account_process/__manifest__.py new file mode 100644 index 00000000..f701deb7 --- /dev/null +++ b/jikimo_account_process/__manifest__.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +{ + 'name': "jikimo_account_process", + + 'summary': """ + Short (1 phrase/line) summary of the module's purpose, used as + subtitle on modules listing or apps.openerp.com""", + + 'description': """ + Long description of module's purpose + """, + + 'author': "My Company", + 'website': "https://www.yourcompany.com", + + # Categories can be used to filter modules in modules listing + # Check https://github.com/odoo/odoo/blob/16.0/odoo/addons/base/data/ir_module_category_data.xml + # for the full list + 'category': 'Uncategorized', + 'version': '0.1', + + # any module necessary for this one to work correctly + 'depends': ['base', 'account'], + + # always loaded + 'data': [ + # 'security/ir.model.access.csv', + # 'views/views.xml', + # 'views/templates.xml', + ], + # only loaded in demonstration mode + 'demo': [ + # 'demo/demo.xml', + ], +} diff --git a/jikimo_account_process/controllers/__init__.py b/jikimo_account_process/controllers/__init__.py new file mode 100644 index 00000000..457bae27 --- /dev/null +++ b/jikimo_account_process/controllers/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import controllers \ No newline at end of file diff --git a/jikimo_account_process/controllers/controllers.py b/jikimo_account_process/controllers/controllers.py new file mode 100644 index 00000000..88f9332a --- /dev/null +++ b/jikimo_account_process/controllers/controllers.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# from odoo import http + + +# class JikimoAccountProcess(http.Controller): +# @http.route('/jikimo_account_process/jikimo_account_process', auth='public') +# def index(self, **kw): +# return "Hello, world" + +# @http.route('/jikimo_account_process/jikimo_account_process/objects', auth='public') +# def list(self, **kw): +# return http.request.render('jikimo_account_process.listing', { +# 'root': '/jikimo_account_process/jikimo_account_process', +# 'objects': http.request.env['jikimo_account_process.jikimo_account_process'].search([]), +# }) + +# @http.route('/jikimo_account_process/jikimo_account_process/objects/', auth='public') +# def object(self, obj, **kw): +# return http.request.render('jikimo_account_process.object', { +# 'object': obj +# }) diff --git a/jikimo_account_process/models/__init__.py b/jikimo_account_process/models/__init__.py new file mode 100644 index 00000000..bef2bae9 --- /dev/null +++ b/jikimo_account_process/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import models +from . import account_move \ No newline at end of file diff --git a/jikimo_account_process/models/account_move.py b/jikimo_account_process/models/account_move.py new file mode 100644 index 00000000..e85d4e16 --- /dev/null +++ b/jikimo_account_process/models/account_move.py @@ -0,0 +1,15 @@ +from odoo import models, fields, api + +from odoo.exceptions import ValidationError + + +class CustomAccountMoveLine(models.Model): + _inherit = 'account.move' + _description = "account move line" + + @api.model_create_multi + def create(self, vals): + for val in vals: + val['name'] = self.env['ir.sequence'].next_by_code('account.move') or '/' + # 因为供应商与客户支付创建流程是先创建move line在修改来填充account_payment与move line的关联 + return super(CustomAccountMoveLine, self).create(vals) \ No newline at end of file diff --git a/jikimo_account_process/models/models.py b/jikimo_account_process/models/models.py new file mode 100644 index 00000000..ea14f4a4 --- /dev/null +++ b/jikimo_account_process/models/models.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +# from odoo import models, fields, api + + +# class jikimo_account_process(models.Model): +# _name = 'jikimo_account_process.jikimo_account_process' +# _description = 'jikimo_account_process.jikimo_account_process' + +# name = fields.Char() +# value = fields.Integer() +# value2 = fields.Float(compute="_value_pc", store=True) +# description = fields.Text() +# +# @api.depends('value') +# def _value_pc(self): +# for record in self: +# record.value2 = float(record.value) / 100 diff --git a/jikimo_hide_options/models/models.py b/jikimo_hide_options/models/models.py index 84aee828..8f30543c 100644 --- a/jikimo_hide_options/models/models.py +++ b/jikimo_hide_options/models/models.py @@ -324,4 +324,4 @@ def unlink(self): BaseModel._create = _create -BaseModel.unlink = unlink \ No newline at end of file +# BaseModel.unlink = unlink \ No newline at end of file diff --git a/sf_base/models/common.py b/sf_base/models/common.py index 65dfe13d..9553c60c 100644 --- a/sf_base/models/common.py +++ b/sf_base/models/common.py @@ -96,7 +96,7 @@ class MrsProductionProcess(models.Model): # workcenter_ids = fields.Many2many('mrp.workcenter', 'rel_workcenter_process', required=True) processing_day = fields.Float('加工天数/d') travel_day = fields.Float('路途天数/d') - + sequence = fields.Integer('排序') # class MrsProcessingTechnology(models.Model): # _name = 'sf.processing.technology' @@ -148,6 +148,7 @@ class MrsProductionProcessParameter(models.Model): processing_day = fields.Float('加工天数/d') travel_day = fields.Float('路途天数/d') active = fields.Boolean('有效', default=True) + processing_mm = fields.Char('加工厚度/mm') def name_get(self): result = [] diff --git a/sf_base/views/common_view.xml b/sf_base/views/common_view.xml index 533a3e04..334eaa32 100644 --- a/sf_base/views/common_view.xml +++ b/sf_base/views/common_view.xml @@ -16,7 +16,7 @@ sf.production.process.parameter -
+

@@ -33,11 +33,12 @@ + - + @@ -52,7 +53,7 @@ - + @@ -140,7 +141,7 @@ sf.production.process.category - + @@ -163,7 +164,8 @@ sf.production.process - + + @@ -174,7 +176,7 @@ sf.production.process - +

@@ -192,11 +194,11 @@ - - - + + + - + diff --git a/sf_bf_connect/models/process_status.py b/sf_bf_connect/models/process_status.py index 9c939edd..d0657a83 100644 --- a/sf_bf_connect/models/process_status.py +++ b/sf_bf_connect/models/process_status.py @@ -31,7 +31,7 @@ class StatusChange(models.Model): res = super(StatusChange, self).action_confirm() # 原有方法执行后,进行额外的操作(如调用外部API) - process_start_time = str(datetime.now()) + process_start_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') config = self.env['res.config.settings'].get_values() json1 = { 'params': { diff --git a/sf_machine_connect/controllers/controllers.py b/sf_machine_connect/controllers/controllers.py index 946bb78c..94c0fdcb 100644 --- a/sf_machine_connect/controllers/controllers.py +++ b/sf_machine_connect/controllers/controllers.py @@ -163,6 +163,7 @@ class Sf_Dashboard_Connect(http.Controller): # 停机时间:关机时间 - 运行时间 # 停机时长:关机时间 - 初次上线时间 'img': f'data:image/png;base64,{machine_data.machine_tool_picture.decode("utf-8")}', + 'equipment_type': machine_data.category_id.name, }) return json.dumps(res) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 066cb133..095c1ab1 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1154,7 +1154,7 @@ class ResMrpWorkOrder(models.Model): def button_finish(self): for record in self: if record.routing_type == '装夹预调': - if not record.material_center_point and record.X_deviation_angle > 0: + if not record.material_center_point or record.X_deviation_angle <= 0: raise UserError("请对前置三元检测定位参数进行计算定位") if not record.rfid_code and record.is_rework is False: raise UserError("请扫RFID码进行绑定") @@ -1257,15 +1257,14 @@ class ResMrpWorkOrder(models.Model): # 解绑托盘 def unbind_tray(self): - self.write({ + self.production_id.workorder_ids.write({ 'rfid_code': False, 'tray_serial_number': False, 'tray_product_id': False, 'tray_brand_id': False, 'tray_type_id': False, 'tray_model_id': False, - 'is_trayed': False - }) + 'is_trayed': False}) # 将FTP的检测报告文件下载到临时目录 def download_reportfile_tmp(self, workorder, reportpath): diff --git a/sf_manufacturing/static/src/js/customRFID.js b/sf_manufacturing/static/src/js/customRFID.js index eaa07d8a..cb58b3ea 100644 --- a/sf_manufacturing/static/src/js/customRFID.js +++ b/sf_manufacturing/static/src/js/customRFID.js @@ -3,13 +3,34 @@ $(document).off('keydown') $(document).on('keydown', 'body.o_web_client', function (e) { setTimeout(() => { RFID = '' - }, 200) + }, 200) if(e.key == 'Enter' && e.keyCode == 13 || e.key == 'Tab' && e.keyCode == 9){ + + let fieldValue1 = $('[name="routing_type"]'); + console.log('字段值:', fieldValue1.text()); console.log(RFID) - if(!RFID || RFID.length <= 3) return; - $('[name="button_start"]').trigger('click') - RFID = '' + let fieldValue2 = $('[name="rfid_code"]'); + console.log('字段值2:', fieldValue2.text()); + // if(!RFID || RFID.length <= 3) return; + // $('[name="button_start"]').trigger('click') + // setTimeout(() => { + // $('.o_dialog .modal-footer .btn-primary').trigger('click') + // }, 50) + // RFID = '' + // return; + + // fieldValue2.val() === '') + // 检查字段值是否等于“装夹预调” + if (fieldValue1.text() === '装夹预调') { + if (!RFID || RFID.length <= 3) return; + $('[name="button_start"]').trigger('click'); + setTimeout(() => { + $('.o_dialog .modal-footer .btn-primary').trigger('click'); + }, 100); + } + + RFID = ''; return; } RFID += e.key diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index 107cf4b0..21984206 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -195,7 +195,7 @@ attrs="{'invisible': ['|','|',('routing_type','!=','装夹预调'),('state','!=','progress'),('is_rework','=',True)]}"/>