Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化Rfid绑定工单
# Conflicts: # sf_manufacturing/models/mrp_workorder.py # sf_manufacturing/models/product_template.py # sf_manufacturing/views/mrp_workorder_view.xml
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import base64
|
import base64
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
@@ -823,25 +825,33 @@ class SfWorkOrderBarcodes(models.Model):
|
|||||||
workorder = self.env['mrp.workorder'].browse(self.ids)
|
workorder = self.env['mrp.workorder'].browse(self.ids)
|
||||||
# workorder = self.env['mrp.workorder'].search(
|
# workorder = self.env['mrp.workorder'].search(
|
||||||
# [('routing_type', '=', '装夹预调'), ('production_id', '=', self.production_id.id)])
|
# [('routing_type', '=', '装夹预调'), ('production_id', '=', self.production_id.id)])
|
||||||
|
# workorder_old = self.env['mrp.workorder'].search([('rfid_code', '=', barcode)])
|
||||||
|
# if workorder_old:
|
||||||
|
# raise UserError('该托盘已绑定工件,请先解除绑定!!!')
|
||||||
if workorder:
|
if workorder:
|
||||||
if workorder.routing_type == '装夹预调':
|
if workorder.routing_type == '装夹预调':
|
||||||
stock_move_line = self.env['stock.move.line'].search([('lot_name', '=', barcode)])
|
if workorder.state in ['progress', 'done']:
|
||||||
if stock_move_line.product_id.categ_type == '夹具':
|
work_state = {'progress': '进行中', 'done': '已完工'}
|
||||||
workorder.write({
|
raise UserError('该工单%s,不能重新绑定托盘' % work_state.get(workorder.state))
|
||||||
'tray_serial_number': stock_move_line.lot_name,
|
lots = self.env['stock.lot'].sudo().search([('rfid', '=', barcode)])
|
||||||
'tray_product_id': stock_move_line.product_id.id,
|
if lots:
|
||||||
'tray_brand_id': stock_move_line.product_id.brand_id.id,
|
for lot in lots:
|
||||||
'tray_type_id': stock_move_line.product_id.fixture_material_id.id,
|
if lot.product_id.categ_type == '夹具':
|
||||||
'tray_model_id': stock_move_line.product_id.fixture_model_id.id
|
val = {
|
||||||
})
|
'tray_serial_number': lot.name,
|
||||||
workorder.button_start()
|
'tray_product_id': lot.product_id.id,
|
||||||
# return {
|
'tray_brand_id': lot.product_id.brand_id.id,
|
||||||
# 'type': 'ir.actions.act_window',
|
'tray_type_id': lot.product_id.fixture_material_id.id,
|
||||||
# 'res_model': 'mrp.workorder',
|
'tray_model_id': lot.product_id.fixture_model_id.id,
|
||||||
# 'view_mode': 'form',
|
'rfid_code': barcode
|
||||||
# 'domain': [('id', 'in', workorder.id)],
|
}
|
||||||
# 'target': 'current'
|
workorder.write(val)
|
||||||
# }
|
self.write(val)
|
||||||
|
workorder_rfid = self.env['mrp.workorder'].search(
|
||||||
|
[('production_id', '=', workorder.production_id.id)])
|
||||||
|
if workorder_rfid:
|
||||||
|
for item in workorder_rfid:
|
||||||
|
item.write({'rfid_code': barcode})
|
||||||
else:
|
else:
|
||||||
embryo_stock_lot = self.env['stock.lot'].search([('name', '=', barcode)])
|
embryo_stock_lot = self.env['stock.lot'].search([('name', '=', barcode)])
|
||||||
if embryo_stock_lot:
|
if embryo_stock_lot:
|
||||||
@@ -875,6 +885,56 @@ class SfWorkOrderBarcodes(models.Model):
|
|||||||
for item in workorder_rfid:
|
for item in workorder_rfid:
|
||||||
if item.state == "progress":
|
if item.state == "progress":
|
||||||
item.write({'rfid_code': barcode})
|
item.write({'rfid_code': barcode})
|
||||||
|
raise UserError('该托盘信息不存在!!!')
|
||||||
|
# stock_move_line = self.env['stock.move.line'].search([('lot_name', '=', barcode)])
|
||||||
|
# if stock_move_line.product_id.categ_type == '夹具':
|
||||||
|
# workorder.write({
|
||||||
|
# 'tray_serial_number': stock_move_line.lot_name,
|
||||||
|
# 'tray_product_id': stock_move_line.product_id.id,
|
||||||
|
# 'tray_brand_id': stock_move_line.product_id.brand_id.id,
|
||||||
|
# 'tray_type_id': stock_move_line.product_id.fixture_material_id.id,
|
||||||
|
# 'tray_model_id': stock_move_line.product_id.fixture_model_id.id
|
||||||
|
# })
|
||||||
|
# workorder.button_start()
|
||||||
|
# # return {
|
||||||
|
# # 'type': 'ir.actions.act_window',
|
||||||
|
# # 'res_model': 'mrp.workorder',
|
||||||
|
# # 'view_mode': 'form',
|
||||||
|
# # 'domain': [('id', 'in', workorder.id)],
|
||||||
|
# # 'target': 'current'
|
||||||
|
# # }
|
||||||
|
# else:
|
||||||
|
# embryo_stock_lot = self.env['stock.lot'].search([('name', '=', barcode)])
|
||||||
|
# if embryo_stock_lot:
|
||||||
|
# embryo_stock_move_line = self.env['stock.move.line'].search(
|
||||||
|
# [('product_id', '=', embryo_stock_lot.product_id.id),
|
||||||
|
# ('reference', '=', workorder.production_id.name),
|
||||||
|
# ('lot_id', '=', embryo_stock_lot.id),
|
||||||
|
# ('product_category_name', '=', '坯料')])
|
||||||
|
# if embryo_stock_move_line:
|
||||||
|
# bom_production = self.env['mrp.production'].search(
|
||||||
|
# [('product_id', '=', embryo_stock_lot.product_id.id),
|
||||||
|
# ('origin', '=', workorder.production_id.name)], limit=1, order='id asc')
|
||||||
|
# workpiece_delivery = self.env['sf.workpiece.delivery'].search(
|
||||||
|
# [('workorder_id', '=', workorder.id)], limit=1, order='id asc')
|
||||||
|
# if workpiece_delivery:
|
||||||
|
# embryo_workpiece_code = workpiece_delivery.workpiece_code
|
||||||
|
# if bom_production:
|
||||||
|
# if workpiece_delivery.workpiece_code and bom_production.name not in \
|
||||||
|
# workpiece_delivery.workpiece_code:
|
||||||
|
# embryo_workpiece_code = workpiece_delivery.workpiece_code + ',' + \
|
||||||
|
# bom_production.name
|
||||||
|
# if not workpiece_delivery.workpiece_code:
|
||||||
|
# embryo_workpiece_code = bom_production.name
|
||||||
|
# workpiece_delivery.write({'workpiece_code': embryo_workpiece_code})
|
||||||
|
# else:
|
||||||
|
# raise UserError('工件生产线不一致,请重新确认')
|
||||||
|
# else:
|
||||||
|
# workorder_rfid = self.env['mrp.workorder'].search(
|
||||||
|
# [('production_id', '=', workorder.production_id.id)])
|
||||||
|
# if workorder_rfid:
|
||||||
|
# for item in workorder_rfid:
|
||||||
|
# item.write({'rfid_code': barcode})
|
||||||
|
|
||||||
|
|
||||||
class WorkPieceDelivery(models.Model):
|
class WorkPieceDelivery(models.Model):
|
||||||
|
|||||||
@@ -6,11 +6,10 @@ import os
|
|||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
|
from OCC.Extend.DataExchange import read_step_file
|
||||||
|
from OCC.Extend.DataExchange import write_stl_file
|
||||||
|
|
||||||
|
|
||||||
# from OCC.Extend.DataExchange import read_step_file
|
|
||||||
# from OCC.Extend.DataExchange import write_stl_file
|
|
||||||
|
|
||||||
|
|
||||||
class ResProductMo(models.Model):
|
class ResProductMo(models.Model):
|
||||||
_inherit = 'product.template'
|
_inherit = 'product.template'
|
||||||
@@ -107,7 +106,10 @@ class ResProductMo(models.Model):
|
|||||||
|
|
||||||
@api.onchange('cutting_tool_model_id')
|
@api.onchange('cutting_tool_model_id')
|
||||||
def _onchange_cutting_tool_model_id(self):
|
def _onchange_cutting_tool_model_id(self):
|
||||||
self.specification_id = False
|
for item in self:
|
||||||
|
if item:
|
||||||
|
item.specification_id = False
|
||||||
|
item.cutting_tool_chuck_id = item.cutting_tool_model_id.chuck_id
|
||||||
|
|
||||||
@api.onchange('cutting_tool_material_id')
|
@api.onchange('cutting_tool_material_id')
|
||||||
def _onchange_cutting_tool_material_id(self):
|
def _onchange_cutting_tool_material_id(self):
|
||||||
@@ -310,7 +312,6 @@ class ResProductMo(models.Model):
|
|||||||
self.cutting_tool_is_safety_lock = self.specification_id.is_safe_lock
|
self.cutting_tool_is_safety_lock = self.specification_id.is_safe_lock
|
||||||
self.cutting_tool_fit_nut_model = self.specification_id.nut
|
self.cutting_tool_fit_nut_model = self.specification_id.nut
|
||||||
self.cutting_tool_wrench = self.specification_id.spanner
|
self.cutting_tool_wrench = self.specification_id.spanner
|
||||||
self.cutting_tool_chuck_id = self.specification_id.chuck_id.id
|
|
||||||
self.cutting_tool_jump_accuracy = self.specification_id.diameter_slip_accuracy
|
self.cutting_tool_jump_accuracy = self.specification_id.diameter_slip_accuracy
|
||||||
self.cutting_tool_taper_shank_model = self.specification_id.taper_shank_model
|
self.cutting_tool_taper_shank_model = self.specification_id.taper_shank_model
|
||||||
self.cutting_tool_cooling_type = self.specification_id.cooling_model
|
self.cutting_tool_cooling_type = self.specification_id.cooling_model
|
||||||
|
|||||||
@@ -266,6 +266,21 @@ class ProductionLot(models.Model):
|
|||||||
_name = 'stock.lot'
|
_name = 'stock.lot'
|
||||||
_inherit = ['stock.lot', 'printing.utils']
|
_inherit = ['stock.lot', 'printing.utils']
|
||||||
|
|
||||||
|
rfid = fields.Char('Rfid', readonly=True)
|
||||||
|
product_specification = fields.Char('规格', compute='_compute_product_specification', store=True)
|
||||||
|
|
||||||
|
@api.depends('product_id')
|
||||||
|
def _compute_product_specification(self):
|
||||||
|
for stock in self:
|
||||||
|
if stock:
|
||||||
|
if stock.product_id:
|
||||||
|
if stock.product_id.categ_id.name in '刀具':
|
||||||
|
stock.product_specification = stock.product_id.specification_id.name
|
||||||
|
elif stock.product_id.categ_id.name in '夹具':
|
||||||
|
stock.product_specification = stock.product_id.specification_fixture_id.name
|
||||||
|
else:
|
||||||
|
stock.product_specification = stock.product_id.default_code
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def generate_lot_names1(self, display_name, first_lot, count):
|
def generate_lot_names1(self, display_name, first_lot, count):
|
||||||
"""Generate `lot_names` from a string."""
|
"""Generate `lot_names` from a string."""
|
||||||
@@ -308,7 +323,7 @@ class ProductionLot(models.Model):
|
|||||||
if not last_serial:
|
if not last_serial:
|
||||||
return "%s-%s%03d" % (product.cutting_tool_model_id.code[:-12], now, 1)
|
return "%s-%s%03d" % (product.cutting_tool_model_id.code[:-12], now, 1)
|
||||||
else:
|
else:
|
||||||
return "%s-%s%03d" % (product.cutting_tool_model_id.code[:-12], now, int(last_serial.name[-3:]) + 2)
|
return "%s-%s%03d" % (product.cutting_tool_model_id.code[:-12], now, int(last_serial.name[-3:]) + 1)
|
||||||
else:
|
else:
|
||||||
raise ValidationError('该刀具物料产品的型号字段为空,请补充完整!!!')
|
raise ValidationError('该刀具物料产品的型号字段为空,请补充完整!!!')
|
||||||
|
|
||||||
@@ -363,7 +378,7 @@ class ProductionLot(models.Model):
|
|||||||
# port = 9100 # 可以根据实际情况修改
|
# port = 9100 # 可以根据实际情况修改
|
||||||
|
|
||||||
# 获取默认打印机配置
|
# 获取默认打印机配置
|
||||||
printer_config = self.env['printer.configuration'].search([('model', '=', self._name)], limit=1)
|
printer_config = self.env['printer.configuration'].sudo().search([('model', '=', self._name)], limit=1)
|
||||||
if not printer_config:
|
if not printer_config:
|
||||||
raise UserError('请先配置打印机')
|
raise UserError('请先配置打印机')
|
||||||
host = printer_config.printer_id.ip_address
|
host = printer_config.printer_id.ip_address
|
||||||
|
|||||||
@@ -422,7 +422,8 @@
|
|||||||
|
|
||||||
<div name="product_specification_id" class="mt-1">
|
<div name="product_specification_id" class="mt-1">
|
||||||
规格:
|
规格:
|
||||||
<field name="specification_id"></field>
|
<field name="specification_id"/>
|
||||||
|
<field name="specification_fixture_id"/>
|
||||||
</div>
|
</div>
|
||||||
<t t-if="record.default_code.value">[<field name="default_code"/>]
|
<t t-if="record.default_code.value">[<field name="default_code"/>]
|
||||||
</t>
|
</t>
|
||||||
|
|||||||
@@ -180,10 +180,10 @@
|
|||||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||||
<field name="functional_fixture_type_id"
|
<field name="functional_fixture_type_id"
|
||||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||||
<field name="rfid_code" readonly="1" class="customRFID"
|
|
||||||
|
<field name="rfid_code" force_save="1" readonly="1" cache="True"
|
||||||
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
|
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
|
||||||
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
|
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
|
||||||
<script src="/sf_manufacturing/static/src/js/customRFID.js"></script>
|
|
||||||
</group>
|
</group>
|
||||||
<!-- <group>-->
|
<!-- <group>-->
|
||||||
<!-- <div>-->
|
<!-- <div>-->
|
||||||
@@ -238,6 +238,7 @@
|
|||||||
<!-- </page>-->
|
<!-- </page>-->
|
||||||
<page string="工件装夹" attrs='{"invisible": [("routing_type","!=","装夹预调")]}'>
|
<page string="工件装夹" attrs='{"invisible": [("routing_type","!=","装夹预调")]}'>
|
||||||
<group>
|
<group>
|
||||||
|
<field name="_barcode_scanned" widget="barcode_handler"/>
|
||||||
<group string="卡盘">
|
<group string="卡盘">
|
||||||
<field name="chuck_serial_number"/>
|
<field name="chuck_serial_number"/>
|
||||||
<field name="chuck_name"/>
|
<field name="chuck_name"/>
|
||||||
@@ -246,7 +247,6 @@
|
|||||||
<field name="chuck_model_id"/>
|
<field name="chuck_model_id"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="托盘">
|
<group string="托盘">
|
||||||
<field name="_barcode_scanned" widget="barcode_handler"/>
|
|
||||||
<field name="tray_serial_number" readonly="1" string="序列号"/>
|
<field name="tray_serial_number" readonly="1" string="序列号"/>
|
||||||
<field name="tray_product_id" readonly="1" string="名称"/>
|
<field name="tray_product_id" readonly="1" string="名称"/>
|
||||||
<field name="tray_brand_id" readonly="1" string="品牌"/>
|
<field name="tray_brand_id" readonly="1" string="品牌"/>
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
<button string="打印二维码" name="print_single_method" type="object" class="btn-primary"/>
|
<button string="打印二维码" name="print_single_method" type="object" class="btn-primary"/>
|
||||||
</header>
|
</header>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='product_id']" position="before">
|
||||||
|
<field name="rfid" attrs="{'invisible': [('rfid', '=', False)]}"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='product_id']" position="after">
|
||||||
|
<field name="product_specification"/>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -2421,7 +2421,7 @@ class CuttingToolBasicParameters(models.Model):
|
|||||||
'active': integral_tool_item['active'],
|
'active': integral_tool_item['active'],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
self.write({
|
self.search([('code', '=', integral_tool_item['code'])]).write({
|
||||||
'name': integral_tool_item['name'],
|
'name': integral_tool_item['name'],
|
||||||
'total_length': integral_tool_item['total_length'],
|
'total_length': integral_tool_item['total_length'],
|
||||||
'blade_diameter': integral_tool_item['blade_diameter'],
|
'blade_diameter': integral_tool_item['blade_diameter'],
|
||||||
@@ -2482,7 +2482,7 @@ class CuttingToolBasicParameters(models.Model):
|
|||||||
'active': blade_item['active'],
|
'active': blade_item['active'],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
self.write({
|
self.search([('code', '=', blade_item['code'])]).write({
|
||||||
'name': blade_item['name'],
|
'name': blade_item['name'],
|
||||||
'length': blade_item['length'],
|
'length': blade_item['length'],
|
||||||
'thickness': blade_item['thickness'],
|
'thickness': blade_item['thickness'],
|
||||||
@@ -2539,7 +2539,7 @@ class CuttingToolBasicParameters(models.Model):
|
|||||||
'active': chuck_item['active'],
|
'active': chuck_item['active'],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
self.write({
|
self.search([('code', '=', chuck_item['code'])]).write({
|
||||||
'name': chuck_item['name'],
|
'name': chuck_item['name'],
|
||||||
'er_size_model': chuck_item['size_model'],
|
'er_size_model': chuck_item['size_model'],
|
||||||
'min_clamping_diameter': chuck_item['clamping_diameter_min'],
|
'min_clamping_diameter': chuck_item['clamping_diameter_min'],
|
||||||
@@ -2598,7 +2598,7 @@ class CuttingToolBasicParameters(models.Model):
|
|||||||
'active': cutter_arbor_item['active'],
|
'active': cutter_arbor_item['active'],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
self.write({
|
self.search([('code', '=', cutter_arbor_item['code'])]).write({
|
||||||
'name': cutter_arbor_item['name'],
|
'name': cutter_arbor_item['name'],
|
||||||
'height': cutter_arbor_item['height'],
|
'height': cutter_arbor_item['height'],
|
||||||
'width': cutter_arbor_item['width'],
|
'width': cutter_arbor_item['width'],
|
||||||
@@ -2662,7 +2662,7 @@ class CuttingToolBasicParameters(models.Model):
|
|||||||
'active': cutter_head_item['active'],
|
'active': cutter_head_item['active'],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
self.write({
|
self.search([('code', '=', cutter_head_item['code'])]).write({
|
||||||
'name': cutter_head_item['name'],
|
'name': cutter_head_item['name'],
|
||||||
'install_blade_tip_num': cutter_head_item['number_blade_installed'],
|
'install_blade_tip_num': cutter_head_item['number_blade_installed'],
|
||||||
'blade_diameter': cutter_head_item['blade_diameter'],
|
'blade_diameter': cutter_head_item['blade_diameter'],
|
||||||
@@ -2691,57 +2691,38 @@ class CuttingToolBasicParameters(models.Model):
|
|||||||
for knife_handle_item in basic_parameters_knife_handle_list:
|
for knife_handle_item in basic_parameters_knife_handle_list:
|
||||||
knife_handle = self.search(
|
knife_handle = self.search(
|
||||||
[('code', '=', knife_handle_item['code']), ('active', 'in', [True, False])])
|
[('code', '=', knife_handle_item['code']), ('active', 'in', [True, False])])
|
||||||
|
val = {
|
||||||
|
'name': knife_handle_item['name'],
|
||||||
|
'taper_shank_model': knife_handle_item['taper_shank_model'],
|
||||||
|
'total_length': knife_handle_item['total_length'],
|
||||||
|
'flange_shank_length': knife_handle_item['flange_length'],
|
||||||
|
'flange_diameter': knife_handle_item['flange_diameter'],
|
||||||
|
'shank_length': knife_handle_item['shank_length'],
|
||||||
|
'shank_diameter': knife_handle_item['shank_diameter'],
|
||||||
|
'min_clamping_diameter': knife_handle_item['clamping_diameter_min'],
|
||||||
|
'max_clamping_diameter': knife_handle_item['clamping_diameter_max'],
|
||||||
|
'clamping_mode': knife_handle_item['clamping_way'],
|
||||||
|
'tool_changing_time': knife_handle_item['tool_changing_time'],
|
||||||
|
'max_rotate_speed': knife_handle_item['rotate_speed_max'],
|
||||||
|
'diameter_slip_accuracy': knife_handle_item['diameter_slip_accuracy'],
|
||||||
|
'cooling_model': knife_handle_item['cooling_model'],
|
||||||
|
'fit_chuck_size': knife_handle_item['fit_chuck_size'],
|
||||||
|
'is_quick_cutting': knife_handle_item['is_quick_cutting'],
|
||||||
|
'is_safe_lock': knife_handle_item['is_safe_lock'],
|
||||||
|
'screw': knife_handle_item['fit_wrench_model'],
|
||||||
|
'nut': knife_handle_item['fit_nut_model'],
|
||||||
|
'dynamic_balance_class': knife_handle_item['dynamic_balance_class'],
|
||||||
|
'active': knife_handle_item['active'],
|
||||||
|
}
|
||||||
if not knife_handle:
|
if not knife_handle:
|
||||||
self.create({
|
val['code'] = knife_handle_item['code']
|
||||||
'name': knife_handle_item['name'],
|
val['cutting_tool_type'] = '刀柄'
|
||||||
'code': knife_handle_item['code'],
|
val['standard_library_id'] = self.env['sf.cutting_tool.standard.library'].search(
|
||||||
'cutting_tool_type': '刀柄',
|
[('code', '=', knife_handle_item['standard_library_code'].replace("JKM", result[
|
||||||
'taper_shank_model': knife_handle_item['taper_shank_model'],
|
'factory_short_name']))]).id
|
||||||
'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
|
self.create(val)
|
||||||
[('code', '=', knife_handle_item['standard_library_code'].replace("JKM", result[
|
|
||||||
'factory_short_name']))]).id,
|
|
||||||
'total_length': knife_handle_item['total_length'],
|
|
||||||
'flange_shank_length': knife_handle_item['flange_length'],
|
|
||||||
'flange_diameter': knife_handle_item['flange_diameter'],
|
|
||||||
'shank_length': knife_handle_item['shank_length'],
|
|
||||||
'shank_diameter': knife_handle_item['shank_diameter'],
|
|
||||||
'min_clamping_diameter': knife_handle_item['clamping_diameter_min'],
|
|
||||||
'max_clamping_diameter': knife_handle_item['clamping_diameter_max'],
|
|
||||||
'clamping_mode': knife_handle_item['clamping_way'],
|
|
||||||
'tool_changing_time': knife_handle_item['tool_changing_time'],
|
|
||||||
'max_rotate_speed': knife_handle_item['rotate_speed_max'],
|
|
||||||
'diameter_slip_accuracy': knife_handle_item['diameter_slip_accuracy'],
|
|
||||||
'cooling_model': knife_handle_item['cooling_model'],
|
|
||||||
'is_quick_cutting': knife_handle_item['is_quick_cutting'],
|
|
||||||
'is_safe_lock': knife_handle_item['is_safe_lock'],
|
|
||||||
'screw': knife_handle_item['fit_wrench_model'],
|
|
||||||
'nut': knife_handle_item['fit_nut_model'],
|
|
||||||
'dynamic_balance_class': knife_handle_item['dynamic_balance_class'],
|
|
||||||
'active': knife_handle_item['active'],
|
|
||||||
})
|
|
||||||
else:
|
else:
|
||||||
self.write({
|
self.search([('code', '=', knife_handle_item['code'])]).write(val)
|
||||||
'name': knife_handle_item['name'],
|
|
||||||
'taper_shank_model': knife_handle_item['taper_shank_model'],
|
|
||||||
'total_length': knife_handle_item['total_length'],
|
|
||||||
'flange_shank_length': knife_handle_item['flange_length'],
|
|
||||||
'flange_diameter': knife_handle_item['flange_diameter'],
|
|
||||||
'shank_length': knife_handle_item['shank_length'],
|
|
||||||
'shank_diameter': knife_handle_item['shank_diameter'],
|
|
||||||
'min_clamping_diameter': knife_handle_item['clamping_diameter_min'],
|
|
||||||
'max_clamping_diameter': knife_handle_item['clamping_diameter_max'],
|
|
||||||
'clamping_mode': knife_handle_item['clamping_way'],
|
|
||||||
'tool_changing_time': knife_handle_item['tool_changing_time'],
|
|
||||||
'max_rotate_speed': knife_handle_item['rotate_speed_max'],
|
|
||||||
'diameter_slip_accuracy': knife_handle_item['diameter_slip_accuracy'],
|
|
||||||
'cooling_model': knife_handle_item['cooling_model'],
|
|
||||||
'is_quick_cutting': knife_handle_item['is_quick_cutting'],
|
|
||||||
'is_safe_lock': knife_handle_item['is_safe_lock'],
|
|
||||||
'screw': knife_handle_item['fit_wrench_model'],
|
|
||||||
'nut': knife_handle_item['fit_nut_model'],
|
|
||||||
'dynamic_balance_class': knife_handle_item['dynamic_balance_class'],
|
|
||||||
'active': knife_handle_item['active'],
|
|
||||||
})
|
|
||||||
else:
|
else:
|
||||||
raise ValidationError("刀具物料基本参数认证未通过")
|
raise ValidationError("刀具物料基本参数认证未通过")
|
||||||
|
|
||||||
@@ -3097,6 +3078,7 @@ class CuttingToolBasicParameters(models.Model):
|
|||||||
'cooling_model': knife_handle_item['cooling_model'],
|
'cooling_model': knife_handle_item['cooling_model'],
|
||||||
'is_quick_cutting': knife_handle_item['is_quick_cutting'],
|
'is_quick_cutting': knife_handle_item['is_quick_cutting'],
|
||||||
'is_safe_lock': knife_handle_item['is_safe_lock'],
|
'is_safe_lock': knife_handle_item['is_safe_lock'],
|
||||||
|
'fit_chuck_size': knife_handle_item['fit_chuck_size'],
|
||||||
'screw': knife_handle_item['fit_wrench_model'],
|
'screw': knife_handle_item['fit_wrench_model'],
|
||||||
'nut': knife_handle_item['fit_nut_model'],
|
'nut': knife_handle_item['fit_nut_model'],
|
||||||
'dynamic_balance_class': knife_handle_item['dynamic_balance_class'],
|
'dynamic_balance_class': knife_handle_item['dynamic_balance_class'],
|
||||||
@@ -3121,6 +3103,7 @@ class CuttingToolBasicParameters(models.Model):
|
|||||||
'max_rotate_speed': knife_handle_item['rotate_speed_max'],
|
'max_rotate_speed': knife_handle_item['rotate_speed_max'],
|
||||||
'diameter_slip_accuracy': knife_handle_item['diameter_slip_accuracy'],
|
'diameter_slip_accuracy': knife_handle_item['diameter_slip_accuracy'],
|
||||||
'cooling_model': knife_handle_item['cooling_model'],
|
'cooling_model': knife_handle_item['cooling_model'],
|
||||||
|
'fit_chuck_size': knife_handle_item['fit_chuck_size'],
|
||||||
'is_quick_cutting': knife_handle_item['is_quick_cutting'],
|
'is_quick_cutting': knife_handle_item['is_quick_cutting'],
|
||||||
'is_safe_lock': knife_handle_item['is_safe_lock'],
|
'is_safe_lock': knife_handle_item['is_safe_lock'],
|
||||||
'screw': knife_handle_item['fit_wrench_model'],
|
'screw': knife_handle_item['fit_wrench_model'],
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class StockLot(models.Model):
|
|||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, sf_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
str_url = sf_sync_config['sf_url'] + "/api/tool_material_stock/create"
|
str_url = sf_sync_config['sf_url'] + "/api/tool_material_stock/create"
|
||||||
objs_all = self.env['stock.lot'].search([('id', '=', self.id)])
|
objs_all = self.env['stock.lot'].search([('id', '=', self.id), ('active', 'in', [True, False])])
|
||||||
tool_material_stock_list = []
|
tool_material_stock_list = []
|
||||||
if objs_all:
|
if objs_all:
|
||||||
for item in objs_all:
|
for item in objs_all:
|
||||||
|
|||||||
@@ -1056,7 +1056,7 @@
|
|||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="barcode_id" invisible="True"/>
|
<field name="barcode_id" invisible="True"/>
|
||||||
<field name="rfid" string="功能刀具rfid" readonly="false"/>
|
<field name="rfid" string="功能刀具rfid"/>
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="after_assembly_functional_tool_name"
|
<field name="after_assembly_functional_tool_name"
|
||||||
string="功能刀具名称"/>
|
string="功能刀具名称"/>
|
||||||
|
|||||||
@@ -295,35 +295,71 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
"""
|
"""
|
||||||
for record in self:
|
for record in self:
|
||||||
if 'DJWL' in barcode:
|
if 'DJWL' in barcode:
|
||||||
records = record.env['stock.lot'].search([('name', '=', barcode)])
|
lot_ids = record.env['stock.lot'].sudo().search([('name', '=', barcode)])
|
||||||
if not records:
|
if not lot_ids:
|
||||||
raise ValidationError('扫描的条形码数据不存在,请重新扫描!')
|
raise ValidationError('扫描的条形码数据不存在,请重新扫描!')
|
||||||
for record_stock_lot in records:
|
for lot_id in lot_ids:
|
||||||
if record_stock_lot.quant_ids[-1].location_id.name == '刀具组装位置':
|
if lot_id.quant_ids[-1].location_id.name == '刀具组装位置':
|
||||||
raise ValidationError('该刀具物料已使用,请重新选择!!!')
|
raise ValidationError('该刀具物料已使用,请重新扫描!!!')
|
||||||
elif record_stock_lot.quant_ids[-1].location_id.name not in '刀具房':
|
elif lot_id.quant_ids[-1].location_id.name not in '刀具房':
|
||||||
raise ValidationError('该刀具物料未入库,请重新选择!!!')
|
raise ValidationError('该刀具物料未入库,请重新扫描!!!')
|
||||||
tool_material_name = record_stock_lot.product_id.cutting_tool_material_id.name
|
tool_material_name = lot_id.product_id.cutting_tool_material_id.name
|
||||||
if tool_material_name == '整体式刀具':
|
if tool_material_name == '整体式刀具':
|
||||||
record.integral_code_id = record_stock_lot.id
|
record.integral_code_id = lot_id.id
|
||||||
elif tool_material_name == '刀片':
|
elif tool_material_name == '刀片':
|
||||||
record.blade_code_id = record_stock_lot.id
|
record.blade_code_id = lot_id.id
|
||||||
elif tool_material_name == '刀杆':
|
elif tool_material_name == '刀杆':
|
||||||
record.bar_code_id = record_stock_lot.id
|
record.bar_code_id = lot_id.id
|
||||||
elif tool_material_name == '刀盘':
|
elif tool_material_name == '刀盘':
|
||||||
record.pad_code_id = record_stock_lot.id
|
record.pad_code_id = lot_id.id
|
||||||
elif tool_material_name == '刀柄':
|
elif tool_material_name == '刀柄':
|
||||||
record.handle_code_id = record_stock_lot.id
|
record.handle_code_id = lot_id.id
|
||||||
|
record.chuck_code_id = record.get_chuck_code_id(lot_id).id or False
|
||||||
elif tool_material_name == '夹头':
|
elif tool_material_name == '夹头':
|
||||||
record.chuck_code_id = record_stock_lot.id
|
record.chuck_code_id = lot_id.id
|
||||||
else:
|
else:
|
||||||
raise ValidationError('扫描的刀具物料不存在,请重新扫描!')
|
raise ValidationError('扫描的刀具物料不存在,请重新扫描!')
|
||||||
else:
|
else:
|
||||||
record.rfid = barcode
|
lot_ids = self.env['stock.lot'].sudo().search([('rfid', '=', barcode)])
|
||||||
|
if not lot_ids:
|
||||||
|
raise ValidationError('扫描的刀具物料不存在,请重新扫描!')
|
||||||
|
for lot_id in lot_ids:
|
||||||
|
if lot_id.quant_ids[-1].location_id.name in '刀具房':
|
||||||
|
record.handle_code_id = lot_id.id
|
||||||
|
record.chuck_code_id = record.get_chuck_code_id(lot_id).id or False
|
||||||
|
elif lot_id.quant_ids[-1].location_id.name == '刀具组装位置':
|
||||||
|
raise ValidationError('该刀柄已使用,请重新扫描!!!')
|
||||||
|
else:
|
||||||
|
raise ValidationError('该刀柄未入库,请重新扫描!!!')
|
||||||
|
|
||||||
|
def get_chuck_code_id(self, lot_id):
|
||||||
|
# 适用夹头型号
|
||||||
|
cutting_tool_chuck_id = lot_id.product_id.cutting_tool_chuck_id
|
||||||
|
# 适用夹头尺寸
|
||||||
|
fit_chuck_size = lot_id.product_id.cutting_tool_fit_chuck_size
|
||||||
|
# 适用夹头产品
|
||||||
|
chuck_product_id = self.env['product.product'].sudo().search(
|
||||||
|
[('cutting_tool_model_id', '=', cutting_tool_chuck_id.id),
|
||||||
|
('cutting_tool_er_size_model', '=', fit_chuck_size)])
|
||||||
|
# 适用夹头产品序列号
|
||||||
|
chuck_product_lot_ids = self.env['stock.lot'].sudo().search(
|
||||||
|
[('product_id', '=', chuck_product_id.id), ('tool_material_status', '=', '可用')])
|
||||||
|
for chuck_product_lot_id in chuck_product_lot_ids:
|
||||||
|
if chuck_product_lot_id.quant_ids[-1].location_id.name in '刀具房':
|
||||||
|
return chuck_product_lot_id
|
||||||
|
return False
|
||||||
|
|
||||||
|
@api.depends('handle_code_id')
|
||||||
|
def _compute_rfid(self):
|
||||||
|
for item in self:
|
||||||
|
if item:
|
||||||
|
item.rfid = item.handle_code_id.rfid
|
||||||
|
else:
|
||||||
|
item.rfid = None
|
||||||
|
|
||||||
# 组装功能刀具参数信息
|
# 组装功能刀具参数信息
|
||||||
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号')
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号')
|
||||||
rfid = fields.Char('Rfid', required=True)
|
rfid = fields.Char('Rfid', readonly=True, store=True, compute='_compute_rfid')
|
||||||
tool_code = fields.Char(string='功能刀具编码', readonly=True, compute='_compute_tool_code')
|
tool_code = fields.Char(string='功能刀具编码', readonly=True, compute='_compute_tool_code')
|
||||||
after_assembly_functional_tool_name = fields.Char(string='组装后功能刀具名称', compute='_compute_name')
|
after_assembly_functional_tool_name = fields.Char(string='组装后功能刀具名称', compute='_compute_name')
|
||||||
after_assembly_functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model',
|
after_assembly_functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model',
|
||||||
@@ -377,7 +413,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
num = self._get_code(str_2)
|
num = self._get_code(str_2)
|
||||||
obj.tool_code = str_2 + str(num)
|
obj.tool_code = str_2 + str(num)
|
||||||
else:
|
else:
|
||||||
obj.tool_code = None
|
obj.tool_code = ''
|
||||||
|
|
||||||
def _get_code(self, str_2):
|
def _get_code(self, str_2):
|
||||||
functional_tool_assembly = self.env['sf.functional.tool.assembly'].sudo().search(
|
functional_tool_assembly = self.env['sf.functional.tool.assembly'].sudo().search(
|
||||||
@@ -434,28 +470,23 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
else:
|
else:
|
||||||
record.L_D_number = 0
|
record.L_D_number = 0
|
||||||
|
|
||||||
@api.constrains('after_assembly_tool_loading_length', 'after_assembly_functional_tool_length')
|
@api.constrains('after_assembly_tool_loading_length', 'after_assembly_functional_tool_length',
|
||||||
|
'after_assembly_max_lifetime_value', 'after_assembly_alarm_value',
|
||||||
|
'after_assembly_effective_length', 'hiding_length')
|
||||||
def _check_length_control(self):
|
def _check_length_control(self):
|
||||||
for obj in self:
|
for obj in self:
|
||||||
if obj.after_assembly_tool_loading_length == 0:
|
if obj.after_assembly_tool_loading_length == 0:
|
||||||
raise ValidationError('组装参数信息【总长度】不能为0!!!')
|
raise ValidationError('组装参数信息【总长度】不能为0!!!')
|
||||||
if obj.after_assembly_functional_tool_length == 0:
|
if obj.after_assembly_functional_tool_length == 0:
|
||||||
raise ValidationError('组装参数信息【伸出长】不能为0!!!')
|
raise ValidationError('组装参数信息【伸出长】不能为0!!!')
|
||||||
|
if obj.after_assembly_max_lifetime_value == 0:
|
||||||
@api.constrains('rfid')
|
raise ValidationError('组装参数信息【最大寿命值】不能为0!!!')
|
||||||
def _check_rfid(self):
|
if obj.after_assembly_alarm_value == 0:
|
||||||
self.get_rfid()
|
raise ValidationError('组装参数信息【报警值】不能为0!!!')
|
||||||
|
if obj.after_assembly_effective_length == 0:
|
||||||
@api.onchange('rfid')
|
raise ValidationError('组装参数信息【有效长】不能为0!!!')
|
||||||
def _onchange_rfid(self):
|
if obj.hiding_length == 0:
|
||||||
self.get_rfid()
|
raise ValidationError('组装参数信息【避空长】不能为0!!!')
|
||||||
|
|
||||||
def get_rfid(self):
|
|
||||||
for obj in self:
|
|
||||||
if obj.rfid:
|
|
||||||
tool_entity = self.env['sf.functional.cutting.tool.entity'].sudo().search([('rfid', '=', obj.rfid)])
|
|
||||||
if tool_entity:
|
|
||||||
raise ValidationError('【%s】的Rfid已被使用,请重新录入!!!' % obj.rfid)
|
|
||||||
|
|
||||||
def functional_tool_assembly(self):
|
def functional_tool_assembly(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
import base64
|
import base64
|
||||||
@@ -417,6 +419,8 @@ class Sf_stock_move_line(models.Model):
|
|||||||
# lot_qr_code = fields.Binary(string='二维码', compute='_compute_lot_qr_code', store=True)
|
# lot_qr_code = fields.Binary(string='二维码', compute='_compute_lot_qr_code', store=True)
|
||||||
lot_qr_code = fields.Binary(string='二维码', compute='_compute_lot_qr_code', store=True)
|
lot_qr_code = fields.Binary(string='二维码', compute='_compute_lot_qr_code', store=True)
|
||||||
|
|
||||||
|
rfid = fields.Char('Rfid', readonly=True)
|
||||||
|
|
||||||
def action_revert_inventory(self):
|
def action_revert_inventory(self):
|
||||||
# 检查用户是否有执行操作的权限
|
# 检查用户是否有执行操作的权限
|
||||||
if not self.env.user.has_group('sf_warehouse.group_sf_stock_user'):
|
if not self.env.user.has_group('sf_warehouse.group_sf_stock_user'):
|
||||||
@@ -468,7 +472,7 @@ class Sf_stock_move_line(models.Model):
|
|||||||
# port = 9100 # 可以根据实际情况修改
|
# port = 9100 # 可以根据实际情况修改
|
||||||
|
|
||||||
# 获取默认打印机配置
|
# 获取默认打印机配置
|
||||||
printer_config = self.env['printer.configuration'].search([('model', '=', self._name)], limit=1)
|
printer_config = self.env['printer.configuration'].sudo().search([('model', '=', self._name)], limit=1)
|
||||||
if not printer_config:
|
if not printer_config:
|
||||||
raise UserError('请先配置打印机')
|
raise UserError('请先配置打印机')
|
||||||
host = printer_config.printer_id.ip_address
|
host = printer_config.printer_id.ip_address
|
||||||
@@ -735,6 +739,15 @@ class SfStockPicking(models.Model):
|
|||||||
if line.current_location_id:
|
if line.current_location_id:
|
||||||
line.current_location_id.product_sn_id = False
|
line.current_location_id.product_sn_id = False
|
||||||
line.current_location_id.location_status = '空闲'
|
line.current_location_id.location_status = '空闲'
|
||||||
|
|
||||||
|
for move in self.move_ids:
|
||||||
|
if move and move.product_id.cutting_tool_material_id.name == '刀柄' or '托盘' in (
|
||||||
|
move.product_id.fixture_material_id.name or ''):
|
||||||
|
for item in move.move_line_nosuggest_ids:
|
||||||
|
if item.location_dest_id.name == '进货':
|
||||||
|
if not item.rfid:
|
||||||
|
raise ValidationError('你需要提供%s的Rfid' % move.product_id.name)
|
||||||
|
self.env['stock.lot'].search([('name', '=', item.lot_name)]).write({'rfid': item.rfid})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
# def print_all_barcode(self):
|
# def print_all_barcode(self):
|
||||||
@@ -828,7 +841,30 @@ class SfPickingType(models.Model):
|
|||||||
|
|
||||||
class CustomStockMove(models.Model):
|
class CustomStockMove(models.Model):
|
||||||
_name = 'stock.move'
|
_name = 'stock.move'
|
||||||
_inherit = ['stock.move', 'printing.utils']
|
_inherit = ['stock.move', 'printing.utils', 'barcodes.barcode_events_mixin']
|
||||||
|
|
||||||
|
def on_barcode_scanned(self, barcode):
|
||||||
|
"""
|
||||||
|
采购入库扫码绑定Rfid码
|
||||||
|
"""
|
||||||
|
for record in self:
|
||||||
|
if record:
|
||||||
|
if '刀柄' in (record.product_id.cutting_tool_material_id.name or '') or '托盘' in (
|
||||||
|
record.product_id.fixture_material_id.name or ''):
|
||||||
|
for move_line_nosuggest_id in record.move_line_nosuggest_ids:
|
||||||
|
if move_line_nosuggest_id.rfid:
|
||||||
|
if move_line_nosuggest_id.rfid == barcode:
|
||||||
|
if record.product_id.cutting_tool_material_id.name:
|
||||||
|
raise ValidationError('该刀柄的Rfid已经录入,请勿重复录入!!!')
|
||||||
|
else:
|
||||||
|
raise ValidationError('该托盘的Rfid已经录入,请勿重复录入!!!')
|
||||||
|
else:
|
||||||
|
line_id = int(re.sub(r"\D", "", str(move_line_nosuggest_id.id)))
|
||||||
|
self.env['stock.move.line'].sudo().search([('id', '=', line_id)]).write({'rfid': barcode})
|
||||||
|
move_line_nosuggest_id.rfid = barcode
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise ValidationError('该产品不需要录入Rfid!!!')
|
||||||
|
|
||||||
def action_assign_serial_show_details(self):
|
def action_assign_serial_show_details(self):
|
||||||
# 首先执行原有逻辑
|
# 首先执行原有逻辑
|
||||||
@@ -879,7 +915,7 @@ class CustomStockMove(models.Model):
|
|||||||
# port = 9100 # 可以根据实际情况修改
|
# port = 9100 # 可以根据实际情况修改
|
||||||
|
|
||||||
# 获取默认打印机配置
|
# 获取默认打印机配置
|
||||||
printer_config = self.env['printer.configuration'].search([('model', '=', self._name)], limit=1)
|
printer_config = self.env['printer.configuration'].sudo().search([('model', '=', self._name)], limit=1)
|
||||||
if not printer_config:
|
if not printer_config:
|
||||||
raise UserError('请先配置打印机')
|
raise UserError('请先配置打印机')
|
||||||
host = printer_config.printer_id.ip_address
|
host = printer_config.printer_id.ip_address
|
||||||
|
|||||||
@@ -31,15 +31,16 @@
|
|||||||
<field name="current_location_id" force_save="1"/>
|
<field name="current_location_id" force_save="1"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='location_dest_id']" position="after">
|
<xpath expr="//field[@name='location_dest_id']" position="after">
|
||||||
<field name="destination_location_id" />
|
<field name="destination_location_id"/>
|
||||||
<!-- <field name="location_dest_id_product_type"/> -->
|
<!-- <field name="location_dest_id_product_type"/> -->
|
||||||
<!-- <field name="location_dest_id"/> -->
|
<!-- <field name="location_dest_id"/> -->
|
||||||
<field name="location_dest_id_value" invisible="1"/>
|
<field name="location_dest_id_value" invisible="1"/>
|
||||||
<!-- <button name="button_test" string="测试" type="object" class="oe_highlight"/> -->
|
<!-- <button name="button_test" string="测试" type="object" class="oe_highlight"/> -->
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<record id="sf_stock_move_line_form" model="ir.ui.view">
|
<record id="sf_stock_move_line_form" model="ir.ui.view">
|
||||||
<field name="name">sf.stock.move.line.form</field>
|
<field name="name">sf.stock.move.line.form</field>
|
||||||
<field name="model">stock.move.line</field>
|
<field name="model">stock.move.line</field>
|
||||||
@@ -63,6 +64,9 @@
|
|||||||
<field name="model">stock.move.line</field>
|
<field name="model">stock.move.line</field>
|
||||||
<field name="inherit_id" ref="stock.view_stock_move_line_operation_tree"/>
|
<field name="inherit_id" ref="stock.view_stock_move_line_operation_tree"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='lot_name']" position="after">
|
||||||
|
<field name="rfid"/>
|
||||||
|
</xpath>
|
||||||
<xpath expr="//field[@name='product_uom_id']" position="after">
|
<xpath expr="//field[@name='product_uom_id']" position="after">
|
||||||
<field name="lot_qr_code" widget="image"/>
|
<field name="lot_qr_code" widget="image"/>
|
||||||
<button name="print_single_method" string="打印编码" type="object" class="oe_highlight"/>
|
<button name="print_single_method" string="打印编码" type="object" class="oe_highlight"/>
|
||||||
@@ -103,10 +107,10 @@
|
|||||||
groups="sf_warehouse.group_sf_stock_user" data-hotkey="k"/>
|
groups="sf_warehouse.group_sf_stock_user" data-hotkey="k"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<!-- <xpath expr="//form//sheet//notebook//page//field[@name='move_ids_without_package']" position="before"> -->
|
<!-- <xpath expr="//form//sheet//notebook//page//field[@name='move_ids_without_package']" position="before"> -->
|
||||||
<!-- <field name="check_in" invisible="True"/> -->
|
<!-- <field name="check_in" invisible="True"/> -->
|
||||||
<!-- <button name="print_all_barcode" string="打印所有编码" type="object" attrs="{'invisible': [('check_in', '!=', 'IN')]}"/> -->
|
<!-- <button name="print_all_barcode" string="打印所有编码" type="object" attrs="{'invisible': [('check_in', '!=', 'IN')]}"/> -->
|
||||||
<!-- </xpath> -->
|
<!-- </xpath> -->
|
||||||
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -145,11 +149,23 @@
|
|||||||
<field name="model">stock.move</field>
|
<field name="model">stock.move</field>
|
||||||
<field name="inherit_id" ref="stock.view_stock_move_operations"/>
|
<field name="inherit_id" ref="stock.view_stock_move_operations"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<!-- <xpath expr="//form//field[@name='move_line_ids']" position="before"> -->
|
<!-- <xpath expr="//form//field[@name='move_line_ids']" position="before"> -->
|
||||||
<!-- <button name="print_all_barcode" type="object" string="打印所有编码"/> -->
|
<!-- <button name="print_all_barcode" type="object" string="打印所有编码"/> -->
|
||||||
<!-- </xpath> -->
|
<!-- </xpath> -->
|
||||||
<xpath expr="//form//field[@name='product_id']" position="before">
|
<xpath expr="//form//field[@name='product_id']" position="before">
|
||||||
<button name="print_all_barcode" type="object" string="打印所有编码" class="oe_highlight"/> -->
|
<button name="print_all_barcode" type="object" string="打印所有编码" class="oe_highlight"/>
|
||||||
|
-->
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="mrp_subcontracting_view_stock_move_barcode_scanned" model="ir.ui.view">
|
||||||
|
<field name="name">mrp.subcontracting.stock.move.barcode.scanned.form</field>
|
||||||
|
<field name="model">stock.move</field>
|
||||||
|
<field name="inherit_id" ref="stock.view_stock_move_nosuggest_operations"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='move_line_nosuggest_ids']" position="before">
|
||||||
|
<field name="_barcode_scanned" widget="barcode_handler"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
Reference in New Issue
Block a user