Accept Merge Request #791: (feature/新增工件装夹预调工单任务 -> develop)
Merge Request: 新增工件装夹预调工单任务 Created By: @杨金灵 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @杨金灵 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/791
This commit is contained in:
@@ -1,40 +1,72 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_sf_machine_tool,sf_machine_tool,model_sf_machine_tool,base.group_user,1,1,1,1
|
||||
access_sf_machine_tool_type,sf_machine_tool_type,model_sf_machine_tool_type,base.group_user,1,1,1,1
|
||||
access_sf_machine_brand,sf_machine_brand,model_sf_machine_brand,base.group_user,1,1,1,1
|
||||
access_sf_machine_brand_tags,sf_machine_brand_tags,model_sf_machine_brand_tags,base.group_user,1,1,1,1
|
||||
access_sf_machine_control_system,sf_machine_control_system,model_sf_machine_control_system,base.group_user,1,1,1,1
|
||||
access_sf_processing_order,sf_processing_order,model_sf_processing_order,base.group_user,1,1,1,1
|
||||
access_sf_production_process,sf_production_process,model_sf_production_process,base.group_user,1,1,1,1
|
||||
access_sf_production_materials,sf_production_materials,model_sf_production_materials,base.group_user,1,1,1,1
|
||||
access_sf_materials_model,sf_materials_model,model_sf_materials_model,base.group_user,1,1,1,1
|
||||
access_sf_processing_technology,sf_processing_technology,model_sf_processing_technology,base.group_user,1,1,1,1
|
||||
access_sf_supplier_sort,sf_supplier_sort,model_sf_supplier_sort,base.group_user,1,1,1,1
|
||||
access_sf_production_process_parameter,sf_production_process_parameter,model_sf_production_process_parameter,base.group_user,1,1,1,1
|
||||
access_sf_production_process_category,sf_production_process_category,model_sf_production_process_category,base.group_user,1,1,1,1
|
||||
access_sf_machine_tool_category,sf_machine_tool_category,model_sf_machine_tool_category,base.group_user,1,1,1,1
|
||||
access_sf_cutting_tool_material,sf_cutting_tool_material,model_sf_cutting_tool_material,base.group_user,1,1,1,1
|
||||
access_sf_cutting_tool_type,sf_cutting_tool_type,model_sf_cutting_tool_type,base.group_user,1,1,1,1
|
||||
access_sf_functional_cutting_tool,sf_functional_cutting_tool,model_sf_functional_cutting_tool,base.group_user,1,1,1,1
|
||||
access_sf_functional_cutting_tool_model,sf_functional_cutting_tool_model,model_sf_functional_cutting_tool_model,base.group_user,1,1,1,1
|
||||
access_sf_fixture_material,sf_fixture_material,model_sf_fixture_material,base.group_user,1,1,1,1
|
||||
access_sf_fixture_materials_basic_parameters,sf_fixture_materials_basic_parameters,model_sf_fixture_materials_basic_parameters,base.group_user,1,1,1,1
|
||||
|
||||
access_sf_multi_mounting_type,sf_multi_mounting_type,model_sf_multi_mounting_type,base.group_user,1,1,1,1
|
||||
access_sf_fixture_model,sf_fixture_model,model_sf_fixture_model,base.group_user,1,1,1,1
|
||||
access_sf_machine_tool,sf_machine_tool,model_sf_machine_tool,base.group_user,1,1,1,0
|
||||
access_sf_machine_tool_admin,sf_machine_tool_admin,model_sf_machine_tool,base.group_system,1,1,1,0
|
||||
access_sf_machine_tool_type,sf_machine_tool_type,model_sf_machine_tool_type,base.group_user,1,1,1,0
|
||||
access_sf_machine_tool_type_admin,sf_machine_tool_type_admin,model_sf_machine_tool_type,base.group_system,1,1,1,0
|
||||
access_sf_machine_brand,sf_machine_brand,model_sf_machine_brand,base.group_user,1,1,1,0
|
||||
access_sf_machine_brand_admin,sf_machine_brand_admin,model_sf_machine_brand,base.group_system,1,1,1,0
|
||||
access_sf_machine_brand_tags,sf_machine_brand_tags,model_sf_machine_brand_tags,base.group_user,1,1,1,0
|
||||
access_sf_machine_brand_tags_admin,sf_machine_brand_tags_admin,model_sf_machine_brand_tags,base.group_system,1,1,1,0
|
||||
access_sf_machine_control_system,sf_machine_control_system,model_sf_machine_control_system,base.group_user,1,1,1,0
|
||||
access_sf_machine_control_system_admin,sf_machine_control_system_admin,model_sf_machine_control_system,base.group_system,1,1,1,0
|
||||
access_sf_processing_order,sf_processing_order,model_sf_processing_order,base.group_user,1,1,1,0
|
||||
access_sf_processing_order_admin,sf_processing_order_admin,model_sf_processing_order,base.group_system,1,1,1,0
|
||||
access_sf_production_process,sf_production_process,model_sf_production_process,base.group_user,1,1,1,0
|
||||
access_sf_production_process_admin,sf_production_process_admin,model_sf_production_process,base.group_system,1,1,1,0
|
||||
access_sf_production_materials,sf_production_materials,model_sf_production_materials,base.group_user,1,1,1,0
|
||||
access_sf_production_materials_admin,sf_production_materials_admin,model_sf_production_materials,base.group_system,1,1,1,0
|
||||
access_sf_materials_model,sf_materials_model,model_sf_materials_model,base.group_user,1,1,1,0
|
||||
access_sf_materials_model_admin,sf_materials_model_admin,model_sf_materials_model,base.group_system,1,1,1,0
|
||||
access_sf_processing_technology,sf_processing_technology,model_sf_processing_technology,base.group_user,1,1,1,0
|
||||
access_sf_processing_technology_admin,sf_processing_technology_admin,model_sf_processing_technology,base.group_system,1,1,1,0
|
||||
access_sf_supplier_sort,sf_supplier_sort,model_sf_supplier_sort,base.group_user,1,1,1,0
|
||||
access_sf_supplier_sort_admin,sf_supplier_sort_admin,model_sf_supplier_sort,base.group_system,1,1,1,0
|
||||
access_sf_production_process_parameter,sf_production_process_parameter,model_sf_production_process_parameter,base.group_user,1,1,1,0
|
||||
access_sf_production_process_parameter_admin,sf_production_process_parameter_admin,model_sf_production_process_parameter,base.group_system,1,1,1,0
|
||||
access_sf_production_process_category,sf_production_process_category,model_sf_production_process_category,base.group_user,1,1,1,0
|
||||
access_sf_production_process_category_admin,sf_production_process_category_admin,model_sf_production_process_category,base.group_system,1,1,1,0
|
||||
access_sf_machine_tool_category,sf_machine_tool_category,model_sf_machine_tool_category,base.group_user,1,1,1,0
|
||||
access_sf_machine_tool_category_admin,sf_machine_tool_category_admin,model_sf_machine_tool_category,base.group_system,1,1,1,0
|
||||
access_sf_cutting_tool_material,sf_cutting_tool_material,model_sf_cutting_tool_material,base.group_user,1,1,1,0
|
||||
access_sf_cutting_tool_material_admin,sf_cutting_tool_material_admin,model_sf_cutting_tool_material,base.group_system,1,1,1,0
|
||||
access_sf_cutting_tool_type,sf_cutting_tool_type,model_sf_cutting_tool_type,base.group_user,1,1,1,0
|
||||
access_sf_cutting_tool_type_admin,sf_cutting_tool_type_admin,model_sf_cutting_tool_type,base.group_system,1,1,1,0
|
||||
access_sf_functional_cutting_tool,sf_functional_cutting_tool,model_sf_functional_cutting_tool,base.group_user,1,1,1,0
|
||||
access_sf_functional_cutting_tool_admin,sf_functional_cutting_tool_admin,model_sf_functional_cutting_tool,base.group_system,1,1,1,0
|
||||
access_sf_functional_cutting_tool_model,sf_functional_cutting_tool_model,model_sf_functional_cutting_tool_model,base.group_user,1,1,1,0
|
||||
access_sf_functional_cutting_tool_model_admin,sf_functional_cutting_tool_model_admin,model_sf_functional_cutting_tool_model,base.group_system,1,1,1,0
|
||||
access_sf_fixture_material,sf_fixture_material,model_sf_fixture_material,base.group_user,1,1,1,0
|
||||
access_sf_fixture_material_admin,sf_fixture_material_admin,model_sf_fixture_material,base.group_system,1,1,1,0
|
||||
access_sf_fixture_materials_basic_parameters,sf_fixture_materials_basic_parameters,model_sf_fixture_materials_basic_parameters,base.group_user,1,1,1,0
|
||||
access_sf_fixture_materials_basic_parameters_admin,sf_fixture_materials_basic_parameters_admin,model_sf_fixture_materials_basic_parameters,base.group_system,1,1,1,0
|
||||
access_sf_multi_mounting_type,sf_multi_mounting_type,model_sf_multi_mounting_type,base.group_user,1,1,1,0
|
||||
access_sf_multi_mounting_type_admin,sf_multi_mounting_type_admin,model_sf_multi_mounting_type,base.group_system,1,1,1,0
|
||||
access_sf_fixture_model,sf_fixture_model,model_sf_fixture_model,base.group_user,1,1,1,0
|
||||
access_sf_fixture_model_admin,sf_fixture_model_admin,model_sf_fixture_model,base.group_system,1,1,1,0
|
||||
access_sf_functional_fixture_type,sf_functional_fixture_type,model_sf_functional_fixture_type,base.group_user,1,1,1,1
|
||||
access_sf_functional_fixture,sf_functional_fixture,model_sf_functional_fixture,base.group_user,1,1,1,1
|
||||
access_sf_sync_common,sf_sync_common,model_sf_sync_common,base.group_user,1,1,1,1
|
||||
access_sf_international_standards,sf_international_standards,model_sf_international_standards,base.group_user,1,1,1,1
|
||||
access_material_apply,material_apply,model_material_apply,base.group_user,1,1,1,1
|
||||
access_sf_cutting_tool_standard_library,sf_cutting_tool_standard_library,model_sf_cutting_tool_standard_library,base.group_user,1,1,1,1
|
||||
|
||||
access_sf_tool_materials_basic_parameters,sf_tool_materials_basic_parameters,model_sf_tool_materials_basic_parameters,base.group_user,1,1,1,1
|
||||
access_sf_cutting_speed,sf_cutting_speed,model_sf_cutting_speed,base.group_user,1,1,1,1
|
||||
access_sf_feed_per_tooth,sf_feed_per_tooth,model_sf_feed_per_tooth,base.group_user,1,1,1,1
|
||||
access_sf_functional_fixture_type_admin,sf_functional_fixture_type_admin,model_sf_functional_fixture_type,base.group_system,1,1,1,0
|
||||
access_sf_functional_fixture,sf_functional_fixture,model_sf_functional_fixture,base.group_user,1,1,1,0
|
||||
access_sf_functional_fixture_admin,sf_functional_fixture_admin,model_sf_functional_fixture,base.group_system,1,1,1,0
|
||||
access_sf_sync_common,sf_sync_common,model_sf_sync_common,base.group_user,1,1,1,0
|
||||
access_sf_sync_common,sf_sync_common_admin,model_sf_sync_common_admin,base.group_system,1,1,1,0
|
||||
access_sf_international_standards,sf_international_standards,model_sf_international_standards,base.group_user,1,1,1,0
|
||||
access_sf_international_standards_admin,sf_international_standards_admin,model_sf_international_standards,base.group_system,1,1,1,0
|
||||
access_material_apply,material_apply,model_material_apply,base.group_user,1,1,1,0
|
||||
access_material_apply_admin,material_apply_admin,model_material_apply,base.group_system,1,1,1,0
|
||||
access_sf_cutting_tool_standard_library,sf_cutting_tool_standard_library,model_sf_cutting_tool_standard_library,base.group_user,1,1,1,0
|
||||
access_sf_cutting_tool_standard_library_admin,sf_cutting_tool_standard_library_admin,model_sf_cutting_tool_standard_library,base.group_system,1,1,1,0
|
||||
access_sf_tool_materials_basic_parameters,sf_tool_materials_basic_parameters,model_sf_tool_materials_basic_parameters,base.group_user,1,1,1,0
|
||||
access_sf_tool_materials_basic_parameters_admin,sf_tool_materials_basic_parameters_admin,model_sf_tool_materials_basic_parameters,base.group_system,1,1,1,0
|
||||
access_sf_cutting_speed,sf_cutting_speed,model_sf_cutting_speed,base.group_user,1,1,1,0
|
||||
access_sf_cutting_speed_admin,sf_cutting_speed_admin,model_sf_cutting_speed,base.group_system,1,1,1,0
|
||||
access_sf_cutting_speed_group_purchase_director,sf_cutting_speed_group_purchase_director,model_sf_cutting_speed,sf_base.group_purchase_director,1,1,1,0
|
||||
access_sf_cutting_speed_group_sale_director,sf_cutting_speed_group_sale_director,model_sf_cutting_speed,sf_base.group_sale_director,1,1,1,0
|
||||
access_sf_feed_per_tooth,sf_feed_per_tooth,model_sf_feed_per_tooth,base.group_user,1,1,1,0
|
||||
access_sf_feed_per_tooth_admin,sf_feed_per_tooth_admin,model_sf_feed_per_tooth,base.group_system,1,1,1,0
|
||||
access_sf_ramping_angle,sf_ramping_angle,model_sf_ramping_angle,base.group_user,1,1,1,1
|
||||
access_sf_ramping_angle_admin,sf_ramping_angle_admin,model_sf_ramping_angle,base.group_system,1,1,1,1
|
||||
access_sf_cutting_width_depth,sf_cutting_width_depth,model_sf_cutting_width_depth,base.group_user,1,1,1,1
|
||||
|
||||
access_sf_cutting_width_depth_admin,sf_cutting_width_depth_admin,model_sf_cutting_width_depth,base.group_system,1,1,1,1
|
||||
access_sf_machine_tool,sf_machine_tool,model_sf_machine_tool,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_machine_tool_type,sf_machine_tool_type,model_sf_machine_tool_type,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_machine_brand,sf_machine_brand,model_sf_machine_brand,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
|
||||
|
@@ -50,6 +50,9 @@ class MrpProduction(models.Model):
|
||||
work_state = fields.Char('业务状态')
|
||||
programming_state = fields.Char('编程状态')
|
||||
glb_file = fields.Binary("glb模型文件")
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线')
|
||||
plan_start_processing_time = fields.Datetime('计划开始加工时间')
|
||||
|
||||
|
||||
@api.depends(
|
||||
'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state',
|
||||
@@ -511,7 +514,7 @@ class MrpProduction(models.Model):
|
||||
|
||||
# if completed products make other confirmed/partially_available moves available, assign them
|
||||
done_move_finished_ids = (
|
||||
productions_to_backorder.move_finished_ids | productions_not_to_backorder.move_finished_ids).filtered(
|
||||
productions_to_backorder.move_finished_ids | productions_not_to_backorder.move_finished_ids).filtered(
|
||||
lambda m: m.state == 'done')
|
||||
done_move_finished_ids._trigger_assign()
|
||||
|
||||
|
||||
@@ -122,15 +122,16 @@ class ResMrpWorkOrder(models.Model):
|
||||
chuck_type_id = fields.Char(string="卡盘类型")
|
||||
chuck_model_id = fields.Char(string="卡盘型号")
|
||||
tray_serial_number = fields.Char(string="托盘序列号")
|
||||
tray_name = fields.Char(string="托盘名称")
|
||||
tray_product_id = fields.Many2one('product.product', string="托盘名称")
|
||||
tray_brand_id = fields.Many2one('sf.machine.brand', string="托盘品牌")
|
||||
tray_type_id = fields.Char(string="托盘类型")
|
||||
tray_model_id = fields.Char(string="托盘型号")
|
||||
tray_type_id = fields.Many2one('sf.fixture.material', string="托盘类型")
|
||||
tray_model_id = fields.Many2one('sf.fixture.model', string="托盘型号")
|
||||
total_wight = fields.Float(string="总重量")
|
||||
maximum_carrying_weight = fields.Char(string="最大承载重量[kg]")
|
||||
maximum_clamping_force = fields.Char(string="最大夹持力[n]")
|
||||
production_line = fields.Char(string="生产线")
|
||||
preset_program_information = fields.Char(string="预调程序信息")
|
||||
workpiece_delivery_ids = fields.One2many('sf.workpiece.delivery', 'workorder_id', '工件配送')
|
||||
|
||||
@api.onchange('is_ok')
|
||||
def _onchange_inspection_user_id(self):
|
||||
@@ -195,9 +196,24 @@ class ResMrpWorkOrder(models.Model):
|
||||
work = workorder.production_id.workorder_ids
|
||||
work.compensation_value_x = eval(self.material_center_point)[0]
|
||||
work.compensation_value_y = eval(self.material_center_point)[1]
|
||||
workorder.button_finish()
|
||||
|
||||
except:
|
||||
raise UserError("参数计算有误")
|
||||
|
||||
def button_workpiece_delivery(self):
|
||||
if self.routing_type == '装夹预调':
|
||||
if not self.workpiece_delivery_ids:
|
||||
raise UserError('请添加【工件配送】信息')
|
||||
else:
|
||||
for item in self.workpiece_delivery_ids:
|
||||
if not item.feeder_station_start:
|
||||
raise UserError('【工件配送】明细中请输入起点接驳站')
|
||||
if not item.workpiece_code:
|
||||
raise UserError('请对【同运工件】进行扫描')
|
||||
else:
|
||||
item.write({'task_delivery_time': fields.Datetime.now()})
|
||||
|
||||
# 拼接工单对象属性值
|
||||
def json_workorder_str(self, k, production, route):
|
||||
# 计算预计时长duration_expected
|
||||
@@ -240,7 +256,9 @@ class ResMrpWorkOrder(models.Model):
|
||||
'date_planned_finished': False,
|
||||
'duration_expected': duration_expected,
|
||||
'duration': 0,
|
||||
|
||||
'workpiece_delivery_ids': False if not route.routing_type == '装夹预调' else self.env[
|
||||
'sf.workpiece.delivery'].create(
|
||||
{'production_id': production.id})
|
||||
}]
|
||||
return workorders_values_str
|
||||
|
||||
@@ -551,6 +569,9 @@ class ResMrpWorkOrder(models.Model):
|
||||
raise UserError(_('请先完成上一步工单'))
|
||||
|
||||
def button_finish(self):
|
||||
if self.routing_type == '装夹预调':
|
||||
if not self.material_center_point and self.X_deviation_angle > 0:
|
||||
raise UserError("请对前置三元检测定位参数进行计算定位")
|
||||
if self.picking_out_id:
|
||||
picking_out = self.env['stock.picking'].search([('id', '=', self.picking_out_id.id)])
|
||||
if picking_out.workorder_out_id:
|
||||
@@ -582,11 +603,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
for move_raw_id in self.production_id.move_raw_ids:
|
||||
move_raw_id.quantity_done = move_raw_id.product_uom_qty
|
||||
self.production_id.button_mark_done1()
|
||||
# self.production_id.state = 'done'
|
||||
|
||||
|
||||
|
||||
|
||||
# self.production_id.state = 'done'
|
||||
|
||||
|
||||
class CNCprocessing(models.Model):
|
||||
@@ -724,73 +741,71 @@ class SfWorkOrderBarcodes(models.Model):
|
||||
_name = "mrp.workorder"
|
||||
_inherit = ["mrp.workorder", "barcodes.barcode_events_mixin"]
|
||||
|
||||
# def on_barcode_scanned(self, barcode):
|
||||
# workorder = self.env['mrp.workorder'].browse(self.ids)
|
||||
# if "*" not in barcode:
|
||||
# if self.routing_type == '装夹':
|
||||
# tray_code = self.env['sf.tray'].search([('code', '=', barcode)])
|
||||
# self.tray_code = tray_code.code
|
||||
# self.tray_id = workorder.gettray_auto(barcode)
|
||||
# elif self.routing_type == '前置三元定位检测':
|
||||
# print('我是前置三元检测')
|
||||
# logging.info('我是前置三元检测')
|
||||
# elif self.routing_type == 'CNC加工':
|
||||
# if barcode == 'UP-ALL':
|
||||
# print("我是一键合并下发")
|
||||
# logging.info('我是一键合并下发')
|
||||
# self.up_merge_all()
|
||||
# else:
|
||||
# print('CNC加工')
|
||||
# # print(barcode)
|
||||
# # a = self.env['sf.tray'].search([('code', '=', barcode)])
|
||||
# # print(a)
|
||||
# # # workorder_obj = self.env['mrp.workorder'].search([('tray_code', '=', barcode)], limit=1)
|
||||
# # workorder_obj = self.env['mrp.workorder'].search([('tray_code', '=', barcode)])
|
||||
# # e = workorder_obj.id
|
||||
# # print(workorder_obj)
|
||||
# # action = {
|
||||
# # 'name': '工单',
|
||||
# # 'type': 'ir.actions.act_window',
|
||||
# # # 'view_type': 'form',
|
||||
# # 'view_mode': 'form',
|
||||
# # 'res_model': 'mrp.workorder',
|
||||
# # 'view_id': self.env.ref('mrp.mrp_production_workorder_form_view_inherit').id,
|
||||
# # # 'res_id': workorder_obj.id,
|
||||
# # 'res_id': 1023,
|
||||
# # 'target': 'current',
|
||||
# # # 'context': self.env.context,
|
||||
# # # 'flags': {'initial_mode': 'edit'},
|
||||
# # }
|
||||
# # return action
|
||||
#
|
||||
# elif self.routing_type == '后置三元质量检测':
|
||||
# print('后置三元检测')
|
||||
# elif self.routing_type == '解除装夹':
|
||||
# print("我是解除装夹")
|
||||
# else:
|
||||
# pass
|
||||
#
|
||||
# else:
|
||||
# self.pro_code_ok = workorder.pro_code_is_ok(barcode)
|
||||
def on_barcode_scanned(self, barcode):
|
||||
workorder = self.env['mrp.workorder'].browse(self.ids)
|
||||
# workorder = self.env['mrp.workorder'].search(
|
||||
# [('routing_type', '=', '装夹预调'), ('production_id', '=', self.production_id.id)])
|
||||
if workorder:
|
||||
if workorder.routing_type == '装夹预调':
|
||||
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()
|
||||
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:
|
||||
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 workpiece_delivery.workpiece_code and embryo_stock_lot.name not in \
|
||||
workpiece_delivery.workpiece_code:
|
||||
embryo_workpiece_code = workpiece_delivery.workpiece_code + ',' + \
|
||||
embryo_stock_lot.name
|
||||
if not workpiece_delivery.workpiece_code:
|
||||
embryo_workpiece_code = embryo_stock_lot.name
|
||||
workpiece_delivery.write({'workpiece_code': embryo_workpiece_code})
|
||||
else:
|
||||
raise UserError('工件生产线不一致,请重新确认')
|
||||
|
||||
|
||||
class WorkpieceDelivery(models.Model):
|
||||
_name = 'sf.workpiece.delivery'
|
||||
_description = '工件配送单列表'
|
||||
class WorkPieceDelivery(models.Model):
|
||||
_name = "sf.workpiece.delivery"
|
||||
_description = '工件配送'
|
||||
|
||||
name = fields.Char('工件编码/任务编码')
|
||||
mrp_workorder_id = fields.Many2one('mrp.workorder', string='工件编码/任务编码',
|
||||
domain=[('name', 'in', ('装夹', '解除装夹'))])
|
||||
workorder_id = fields.Many2one('mrp.workorder', string='工单', readonly=True)
|
||||
production_id = fields.Many2one('mrp.production', string='制造订单', readonly=True)
|
||||
production_line_id = fields.Many2one('sf.production.line', compute='_compute_production_line_id',
|
||||
string='目标生产线', readonly=True,
|
||||
store=True)
|
||||
plan_start_processing_time = fields.Datetime('计划开始加工时间', readonly=True)
|
||||
workpiece_code = fields.Char('同运工件编码')
|
||||
feeder_station_start = fields.Char('起点接驳站')
|
||||
feeder_station_destination = fields.Char('目的接驳站')
|
||||
production_line_id = fields.Many2one('sf.production.line', string='目标生产线')
|
||||
task_delivery_time = fields.Datetime('任务下发时间')
|
||||
task_completion_time = fields.Datetime('任务完成时间')
|
||||
delivery_time = fields.Char('配送时长', compute='_compute_delivery_time')
|
||||
status = fields.Selection([('待下发', '待下发'), ('待配送', '待配送'), ('已配送', '已配送')], string='状态',
|
||||
default='待下发')
|
||||
|
||||
@api.depends('production_id.production_line_id')
|
||||
def _compute_production_line_id(self):
|
||||
if self.production_id.production_line_id:
|
||||
self.production_line_id = self.production_id.production_line_id.id
|
||||
self.plan_start_processing_time = self.production_id.plan_start_processing_time
|
||||
|
||||
@api.depends('task_delivery_time', 'task_completion_time')
|
||||
def _compute_delivery_time(self):
|
||||
for obj in self:
|
||||
|
||||
@@ -359,7 +359,6 @@ class ReStockMove(models.Model):
|
||||
materiel_height = fields.Float(string='物料高度', digits=(16, 4))
|
||||
|
||||
def _get_new_picking_values_Res(self, item, sorted_workorders, rescode):
|
||||
logging.info('new_picking-rescode: %s' % rescode)
|
||||
return {
|
||||
'name': self.env['stock.picking']._get_name_Res(rescode),
|
||||
'origin': item.name,
|
||||
@@ -373,165 +372,21 @@ class ReStockMove(models.Model):
|
||||
'state': 'confirmed',
|
||||
}
|
||||
|
||||
# 将采购到的夹具注册到Cloud
|
||||
def _register_fixture(self):
|
||||
create_url = '/api/factory_fixture_material/create'
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
headers = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||
strurl = config['sf_url'] + create_url
|
||||
for item in self:
|
||||
val = {
|
||||
'token': config['token'],
|
||||
'name': item.product_id.name,
|
||||
'brand_code': self.env['sf.machine.brand'].search([('id', '=', item.product_id.brand_id.id)]).code,
|
||||
'fixture_material_code': self.env['sf.fixture.material'].search(
|
||||
[('id', '=', item.product_id.fixture_material_id.id)]).code,
|
||||
'fixture_materials_type_code': self.env['sf.materials.model'].search(
|
||||
[('id', '=', item.product_id.materials_type_id.id)]).materials_no,
|
||||
'fixture_clamping_way': item.product_id.fixture_clamping_way,
|
||||
'fixture_port_type': item.product_id.fixture_port_type,
|
||||
'fixture_length': item.product_id.tool_length,
|
||||
'fixture_width': item.product_id.tool_width,
|
||||
'fixture_height': item.product_id.tool_height,
|
||||
'fixture_weight': item.product_id.tool_weight,
|
||||
'fixture_amount': int(item.quantity_done),
|
||||
'fixture_model_file': '' if not item.product_id.fixture_model_file else base64.b64encode(
|
||||
item.product_id.fixture_model_file).decode(
|
||||
'utf-8'),
|
||||
'fixture_clamp_workpiece_length_max': item.product_id.fixture_clamp_workpiece_length_max,
|
||||
'fixture_clamp_workpiece_width_max': item.product_id.fixture_clamp_workpiece_width_max,
|
||||
'fixture_clamp_workpiece_height_max': item.product_id.fixture_clamp_workpiece_height_max,
|
||||
'fixture_clamp_workpiece_diameter_max': item.product_id.fixture_clamp_workpiece_diameter_max,
|
||||
'fixture_maximum_carrying_weight': item.product_id.fixture_maximum_carrying_weight,
|
||||
'fixture_maximum_clamping_force': item.product_id.fixture_maximum_clamping_force,
|
||||
'fixture_driving_way': '' if not item.product_id.fixture_driving_way
|
||||
else item.product_id.fixture_driving_way,
|
||||
'fixture_apply_machine_tool_type_codes': self.env[
|
||||
'product.template']._json_apply_machine_tool_type_item_code(item),
|
||||
'fixture_through_hole_size': item.product_id.fixture_through_hole_size,
|
||||
'fixture_screw_size': item.product_id.fixture_screw_size,
|
||||
}
|
||||
try:
|
||||
if item.product_id.industry_code:
|
||||
val['industry_code'] = item.product_id.industry_code
|
||||
ret = requests.post(strurl, json={}, data=val, headers=headers)
|
||||
ret = ret.json()
|
||||
if ret['status'] == 200:
|
||||
if not item.product_id.industry_code:
|
||||
item.product_id.write({'register_state': '已注册', 'industry_code': ret['industry_code']})
|
||||
else:
|
||||
item.product_id.write({'register_state': '已注册'})
|
||||
else:
|
||||
item.product_id.write({'register_state': '注册失败'})
|
||||
except Exception as e:
|
||||
raise UserError("注册夹具到云端失败,请联系管理员!")
|
||||
|
||||
# 将采购到的刀具注册到Cloud
|
||||
def _register_cutting_tool(self):
|
||||
create_url = '/api/factory_cutting_tool_material/create'
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
headers = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||
strurl = config['sf_url'] + create_url
|
||||
for item in self:
|
||||
val = {
|
||||
'token': config['token'],
|
||||
'name': item.product_id.name,
|
||||
'brand_code': self.env['sf.machine.brand'].search([('id', '=', item.product_id.brand_id.id)]).code,
|
||||
'cutting_tool_material_code': self.env['sf.cutting.tool.material'].search(
|
||||
[('id', '=', item.product_id.cutting_tool_material_id.id)]).code,
|
||||
'cutting_tool_type_code': self.env['sf.cutting.tool.type'].search(
|
||||
[('id', '=', item.product_id.cutting_tool_type_id.id)]).code,
|
||||
'material_model_code': self.env['sf.materials.model'].search(
|
||||
[('id', '=', item.product_id.materials_type_id.id)]).materials_no,
|
||||
'tool_length': item.product_id.tool_length,
|
||||
'tool_width': item.product_id.tool_width,
|
||||
'tool_height': item.product_id.tool_height,
|
||||
'tool_thickness': item.product_id.tool_thickness,
|
||||
'tool_weight': item.product_id.tool_weight,
|
||||
'tool_hardness': item.product_id.tool_hardness,
|
||||
'coating_material': item.product_id.coating_material,
|
||||
'amount': int(item.quantity_done),
|
||||
# 'model_file': '' if not item.product_id.fixture_model_file else base64.b64encode(
|
||||
# item.product_id.fixture_model_file).decode(
|
||||
# 'utf-8'),
|
||||
'total_length': item.product_id.cutting_tool_total_length,
|
||||
'shank_length': item.product_id.cutting_tool_shank_length,
|
||||
'blade_length': item.product_id.cutting_tool_blade_length,
|
||||
'neck_length': item.product_id.cutting_tool_neck_length,
|
||||
'neck_diameter': item.product_id.cutting_tool_neck_diameter,
|
||||
'shank_diameter': item.product_id.cutting_tool_shank_diameter,
|
||||
'blade_tip_diameter': item.product_id.cutting_tool_blade_tip_diameter,
|
||||
'blade_tip_taper': item.product_id.cutting_tool_blade_tip_taper,
|
||||
'blade_helix_angle': item.product_id.cutting_tool_blade_helix_angle,
|
||||
'blade_type': item.product_id.cutting_tool_blade_type,
|
||||
'coarse_medium_fine': '' if item.product_id.cutting_tool_coarse_medium_fine is False
|
||||
else item.product_id.cutting_tool_coarse_medium_fine,
|
||||
'run_out_accuracy_max': item.product_id.cutting_tool_run_out_accuracy_max,
|
||||
'run_out_accuracy_min': item.product_id.cutting_tool_run_out_accuracy_min,
|
||||
'head_diameter': item.product_id.cutting_tool_head_diameter,
|
||||
'diameter': item.product_id.cutting_tool_diameter,
|
||||
'blade_number': '' if item.product_id.cutting_tool_blade_number is False
|
||||
else item.product_id.cutting_tool_blade_number,
|
||||
'front_angle': item.product_id.cutting_tool_front_angle,
|
||||
'rear_angle': item.product_id.cutting_tool_rear_angle,
|
||||
'main_included_angle': item.product_id.cutting_tool_main_included_angle,
|
||||
'chuck_codes': self.env['product.template']._json_chuck_item_code(item),
|
||||
'cutter_bar_codes': self.env['product.template']._json_cutter_bar_item_code(item),
|
||||
'cutter_pad_codes': self.env['product.template']._json_cutter_pad_item_code(item),
|
||||
'blade_codes': self.env['product.template']._json_blade_item_code(item),
|
||||
'handle_codes': self.env['product.template']._json_handle_item_code(item),
|
||||
'nut': item.product_id.cutting_tool_nut,
|
||||
'top_angle': item.product_id.cutting_tool_top_angle,
|
||||
'jump_accuracy': item.product_id.cutting_tool_jump_accuracy,
|
||||
'working_hardness': item.product_id.cutting_tool_working_hardness,
|
||||
'blade_diameter': item.product_id.cutting_tool_blade_diameter,
|
||||
'wrench': item.product_id.cutting_tool_wrench,
|
||||
'accuracy_level': item.product_id.cutting_tool_accuracy_level,
|
||||
'clamping_way': item.product_id.cutting_tool_clamping_way,
|
||||
'clamping_length': item.product_id.cutting_tool_clamping_length,
|
||||
'clamping_tolerance': item.product_id.cutting_tool_clamping_tolerance,
|
||||
'diameter_max': item.product_id.cutting_tool_diameter_max,
|
||||
'clamping_diameter_min': item.product_id.cutting_tool_clamping_diameter_min,
|
||||
'clamping_diameter_max': item.product_id.cutting_tool_clamping_diameter_max,
|
||||
'detection_accuracy_max': item.product_id.cutting_tool_detection_accuracy_max,
|
||||
'detection_accuracy_min': item.product_id.cutting_tool_detection_accuracy_min,
|
||||
'is_rough_finish': item.product_id.cutting_tool_is_rough_finish,
|
||||
'is_finish': item.product_id.cutting_tool_is_finish,
|
||||
'is_drill_hole': item.product_id.cutting_tool_is_drill_hole,
|
||||
'is_safety_lock': item.product_id.cutting_tool_is_safety_lock,
|
||||
'is_high_speed_cutting': item.product_id.cutting_tool_is_high_speed_cutting,
|
||||
'dynamic_balance_class': item.product_id.cutting_tool_dynamic_balance_class,
|
||||
'change_time': item.product_id.cutting_tool_change_time,
|
||||
'standard_speed': item.product_id.cutting_tool_standard_speed,
|
||||
'speed_max': item.product_id.cutting_tool_speed_max,
|
||||
'cooling_type': item.product_id.cutting_tool_cooling_type,
|
||||
'body_accuracy': item.product_id.cutting_tool_body_accuracy,
|
||||
'apply_lock_nut_model': item.product_id.apply_lock_nut_model,
|
||||
'apply_lock_wrench_model': item.product_id.apply_lock_wrench_model,
|
||||
'tool_taper': item.product_id.cutting_tool_taper,
|
||||
'flange_length': item.product_id.cutting_tool_flange_length,
|
||||
'flange_diameter': item.product_id.cutting_tool_flange_diameter,
|
||||
'outer_diameter': item.product_id.cutting_tool_outer_diameter,
|
||||
'inner_diameter': item.product_id.cutting_tool_inner_diameter,
|
||||
'cooling_suit_type_ids': item.product_id.cooling_suit_type_ids,
|
||||
'er_size_model': item.product_id.cutting_tool_er_size_model,
|
||||
'image': '' if not item.product_id.image_1920 else
|
||||
base64.b64encode(item.product_id.image_1920).decode('utf-8'),
|
||||
}
|
||||
try:
|
||||
if item.product_id.industry_code:
|
||||
val['industry_code'] = item.product_id.industry_code
|
||||
ret = requests.post(strurl, json={}, data=val, headers=headers)
|
||||
ret = ret.json()
|
||||
if ret['status'] == 200:
|
||||
if not item.product_id.industry_code:
|
||||
item.product_id.write({'register_state': '已注册', 'industry_code': ret['industry_code']})
|
||||
else:
|
||||
item.product_id.write({'register_state': '已注册'})
|
||||
else:
|
||||
item.product_id.write({'register_state': '注册失败'})
|
||||
except Exception as e:
|
||||
raise UserError("注册刀具到云端失败,请联系管理员!")
|
||||
def print_serial_numbers(self):
|
||||
if not self.next_serial:
|
||||
raise UserError(_("请先分配序列号再进行打印"))
|
||||
label_data = []
|
||||
for item in self.move_line_ids:
|
||||
label_data.append({
|
||||
'item_id': item.id,
|
||||
})
|
||||
if label_data:
|
||||
report_template = self.env.ref('stock.label_package_template')
|
||||
res = report_template.report_action(label_data)
|
||||
res['id'] = report_template.id
|
||||
return res
|
||||
else:
|
||||
raise UserError(_("没有可打印的标签数据"))
|
||||
|
||||
|
||||
class ReStockQuant(models.Model):
|
||||
|
||||
@@ -25,6 +25,8 @@ access_mrp_workcenter_productivity_manager,mrp_workcenter_productivity,model_mrp
|
||||
|
||||
access_sf_workpiece_delivery,sf_workpiece_delivery,model_sf_workpiece_delivery,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_workpiece_delivery_manager,sf_workpiece_delivery,model_sf_workpiece_delivery,sf_base.group_sf_mrp_manager,1,1,1,0
|
||||
access_sf_workpiece_delivery_admin,sf_workpiece_delivery_admin,model_sf_workpiece_delivery,base.group_system,1,1,1,0
|
||||
|
||||
|
||||
access_mrp_workcenter_productivity_loss_manager,mrp.workcenter.productivity.loss,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_sf_mrp_user,1,1,1,0
|
||||
access_mrp_workcenter_productivity_loss,mrp.workcenter.productivity.loss,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
|
||||
|
@@ -18,19 +18,21 @@
|
||||
<field name="product_qty" sum="Total Qty" string="数量" readonly="1" optional="show"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='product_qty']" position="after">
|
||||
<field name="product_uom_id" string="计量单位" options="{'no_open':True,'no_create':True}" groups="uom.group_uom" optional="show"/>
|
||||
<field name="product_uom_id" string="计量单位" options="{'no_open':True,'no_create':True}"
|
||||
groups="uom.group_uom" optional="show"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='date_planned_start']" position="replace">
|
||||
<field name="date_planned_start" optional="show"/>
|
||||
<field name="date_planned_finished" string="计划结束时间"/>
|
||||
<!-- <field name="date_deadline" widget="remaining_days" attrs="{'invisible': [('state', 'in', ['done', 'cancel'])]}" optional="show"/> -->
|
||||
<!-- <field name="date_deadline" widget="remaining_days" attrs="{'invisible': [('state', 'in', ['done', 'cancel'])]}" optional="show"/> -->
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='production_real_duration']" position="after">
|
||||
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'" decoration-success="reservation_state == 'assigned'"/>
|
||||
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'"
|
||||
decoration-success="reservation_state == 'assigned'"/>
|
||||
</xpath>
|
||||
<!-- <xpath expr="//field[@name='state']" position="before"> -->
|
||||
<!-- <field name="schedule_state" optional="show"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//field[@name='state']" position="before"> -->
|
||||
<!-- <field name="schedule_state" optional="show"/> -->
|
||||
<!-- </xpath> -->
|
||||
<xpath expr="//field[@name='activity_ids']" position="replace">
|
||||
<field name="activity_ids" string="下一个活动" widget="list_activity" optional="hide"/>
|
||||
</xpath>
|
||||
@@ -39,44 +41,54 @@
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='components_availability']" position="replace">
|
||||
<field name="components_availability" options='{"lazy": true}'
|
||||
attrs="{'invisible': [('state', 'not in', ['confirmed', 'progress'])]}"
|
||||
optional="hide"
|
||||
decoration-success="reservation_state == 'assigned' or components_availability_state == 'available'"
|
||||
decoration-warning="reservation_state != 'assigned' and components_availability_state in ('expected', 'available')"
|
||||
decoration-danger="reservation_state != 'assigned' and components_availability_state == 'late'"/>
|
||||
attrs="{'invisible': [('state', 'not in', ['confirmed', 'progress'])]}"
|
||||
optional="hide"
|
||||
decoration-success="reservation_state == 'assigned' or components_availability_state == 'available'"
|
||||
decoration-warning="reservation_state != 'assigned' and components_availability_state in ('expected', 'available')"
|
||||
decoration-danger="reservation_state != 'assigned' and components_availability_state == 'late'"/>
|
||||
</xpath>
|
||||
<!-- <xpath expr="//field[@name='state']" position="after"> -->
|
||||
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
|
||||
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//field[@name='state']" position="after"> -->
|
||||
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
|
||||
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
|
||||
<!-- </xpath> -->
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 增加权限相关的按钮 -->
|
||||
<!-- 制造订单的操作按钮只让制造用户可见 -->
|
||||
<!-- 增加权限相关的按钮 -->
|
||||
<!-- 制造订单的操作按钮只让制造用户可见 -->
|
||||
<record id="custom_mrp_production_form_view" model="ir.ui.view">
|
||||
<field name="name">custom.mrp.production.form</field>
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='state']" position="attributes">
|
||||
<attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done</attribute>
|
||||
<attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='user_id']" position="after">
|
||||
<field name="programming_no"/>
|
||||
<field name="programming_no" readonly="1"/>
|
||||
<field name="work_state" invisible="1"/>
|
||||
<field name="programming_state"/>
|
||||
<field name="programming_state" readonly="1"/>
|
||||
<field name="production_line_id" readonly="1"/>
|
||||
<field name="plan_start_processing_time" readonly="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='action_cancel']" position="replace">
|
||||
<button name="action_cancel" type="object" string="取消" data-hotkey="z"
|
||||
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', True)]}" groups="sf_base.group_sf_mrp_user"/>
|
||||
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', True)]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="(//header//button[@name='button_mark_done'])[1]" position="replace">
|
||||
<button name="button_mark_done" attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '!=', [])]}" string="验证" type="object" class="oe_highlight"
|
||||
confirm="There are no components to consume. Are you still sure you want to continue?" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="button_mark_done"
|
||||
attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '!=', [])]}"
|
||||
string="验证" type="object" class="oe_highlight"
|
||||
confirm="There are no components to consume. Are you still sure you want to continue?"
|
||||
data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="(//header//button[@name='button_mark_done'])[2]" position="replace">
|
||||
<button name="button_mark_done" attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '=', [])]}" string="验证" type="object" class="oe_highlight" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="button_mark_done"
|
||||
attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '=', [])]}"
|
||||
string="验证" type="object" class="oe_highlight" data-hotkey="g"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="(//header//button[@name='button_mark_done'])[3]" position="replace">
|
||||
<button name="button_mark_done" attrs="{'invisible': [
|
||||
@@ -86,7 +98,8 @@
|
||||
'|',
|
||||
('state', 'not in', ('confirmed', 'progress')),
|
||||
('qty_producing', '!=', 0),
|
||||
('state', '!=', 'to_close')]}" string="标记完成" type="object" class="oe_highlight" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
|
||||
('state', '!=', 'to_close')]}" string="标记完成" type="object" class="oe_highlight"
|
||||
data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="(//header//button[@name='button_mark_done'])[4]" position="replace">
|
||||
<button name="button_mark_done" attrs="{'invisible': [
|
||||
@@ -96,61 +109,135 @@
|
||||
'|',
|
||||
('state', 'not in', ('confirmed', 'progress')),
|
||||
('qty_producing', '!=', 0),
|
||||
('state', '!=', 'to_close')]}" string="标记完成" type="object" class="oe_highlight" data-hotkey="g"
|
||||
confirm="There are no components to consume. Are you still sure you want to continue?" groups="sf_base.group_sf_mrp_user"/>
|
||||
('state', '!=', 'to_close')]}" string="标记完成" type="object" class="oe_highlight"
|
||||
data-hotkey="g"
|
||||
confirm="There are no components to consume. Are you still sure you want to continue?"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='button_unplan']" position="replace">
|
||||
<button name="button_unplan" type="object" string="取消安排" attrs="{'invisible': ['|', ('is_planned', '=', False), ('state', '=', 'cancel')]}" data-hotkey="x" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="button_unplan" type="object" string="取消安排"
|
||||
attrs="{'invisible': ['|', ('is_planned', '=', False), ('state', '=', 'cancel')]}"
|
||||
data-hotkey="x" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='button_scrap']" position="replace">
|
||||
<button name="button_scrap" type="object" string="报废" attrs="{'invisible': [('state', 'in', ('cancel', 'draft'))]}" data-hotkey="y" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="button_scrap" type="object" string="报废"
|
||||
attrs="{'invisible': [('state', 'in', ('cancel', 'draft'))]}" data-hotkey="y"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
|
||||
<xpath expr="//header//button[@name='action_confirm']" position="replace">
|
||||
<button name="action_confirm" attrs="{'invisible': [('state', '!=', 'draft')]}" string="确认" type="object" class="oe_highlight" data-hotkey="v" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="action_confirm" attrs="{'invisible': [('state', '!=', 'draft')]}" string="确认"
|
||||
type="object" class="oe_highlight" data-hotkey="v" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='button_plan']" position="replace">
|
||||
<!-- <button name="button_plan" attrs="{'invisible': ['|', '|', ('state', 'not in', ('confirmed', 'progress', 'to_close')), ('workorder_ids', '=', []), ('is_planned', '=', True)]}" type="object" string="Plan" class="oe_highlight" data-hotkey="x" groups="sf_base.group_sf_mrp_user"/> -->
|
||||
<button name="button_plan"
|
||||
attrs="{'invisible': ['|', '|', ('state', 'not in', ('confirmed', 'progress', 'to_close')), ('workorder_ids', '=', []), ('is_planned', '=', True)]}"
|
||||
type="object" string="Plan" class="oe_highlight" data-hotkey="x"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='action_assign']" position="replace">
|
||||
<button name="action_assign" attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done', 'cancel')), ('reserve_visible', '=', False)]}" string="检查可用量" type="object" data-hotkey="q" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="action_assign"
|
||||
attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done', 'cancel')), ('reserve_visible', '=', False)]}"
|
||||
string="Check availability" type="object" data-hotkey="q"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
|
||||
<button name="do_unreserve" type="object" string="取消保留" attrs="{'invisible': [('unreserve_visible', '=', False)]}" data-hotkey="w" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="do_unreserve" type="object" string="Unreserve"
|
||||
attrs="{'invisible': [('unreserve_visible', '=', False)]}" data-hotkey="w"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
|
||||
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}" string="取消阻塞" groups="sf_base.group_sf_mrp_user" type="object" help="Unlock the manufacturing order to adjust what has been consumed or produced." data-hotkey="l"/>
|
||||
<button name="action_toggle_is_locked"
|
||||
attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}"
|
||||
string="Unlock" groups="sf_base.group_sf_mrp_user" type="object"
|
||||
help="Unlock the manufacturing order to adjust what has been consumed or produced."
|
||||
data-hotkey="l"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
|
||||
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}" string="阻塞" groups="sf_base.group_sf_mrp_user" type="object" help="Lock the manufacturing order to prevent changes to what has been consumed or produced." data-hotkey="l"/>
|
||||
<button name="action_toggle_is_locked"
|
||||
attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}"
|
||||
string="Lock" groups="sf_base.group_sf_mrp_user" type="object"
|
||||
help="Lock the manufacturing order to prevent changes to what has been consumed or produced."
|
||||
data-hotkey="l"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='action_serial_mass_produce_wizard']" position="replace">
|
||||
<button name="action_serial_mass_produce_wizard" attrs="{'invisible': [('show_serial_mass_produce', '=', False)]}" string="批量生产" type="object" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="action_serial_mass_produce_wizard"
|
||||
attrs="{'invisible': [('show_serial_mass_produce', '=', False)]}" string="Mass Produce"
|
||||
type="object" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='action_cancel']" position="replace">
|
||||
<button name="action_cancel" type="object" string="取消" data-hotkey="z"
|
||||
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', False)]}"
|
||||
confirm="Some product moves have already been confirmed, this manufacturing order can't be completely cancelled. Are you still sure you want to process ?" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="action_cancel" type="object" string="Cancel" data-hotkey="z"
|
||||
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', False)]}"
|
||||
confirm="Some product moves have already been confirmed, this manufacturing order can't be completely cancelled. Are you still sure you want to process ?"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='button_unbuild']" position="replace">
|
||||
<button name="button_unbuild" type="object" string="拆单" attrs="{'invisible': [('state', '!=', 'done')]}" data-hotkey="shift+v" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="button_unbuild" type="object" string="拆单"
|
||||
attrs="{'invisible': [('state', '!=', 'done')]}" data-hotkey="shift+v"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='button_plan']" position="replace">
|
||||
<!-- <button name="button_plan" attrs="{'invisible': ['|', '|', ('state', 'not in', ('confirmed', 'progress', 'to_close')), ('workorder_ids', '=', []), ('is_planned', '=', True)]}" type="object" string="Plan" class="oe_highlight" data-hotkey="x" groups="sf_base.group_sf_mrp_user"/> -->
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='action_assign']" position="replace">
|
||||
<button name="action_assign"
|
||||
attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done', 'cancel')), ('reserve_visible', '=', False)]}"
|
||||
string="检查可用量" type="object" data-hotkey="q" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
|
||||
<button name="do_unreserve" type="object" string="取消保留"
|
||||
attrs="{'invisible': [('unreserve_visible', '=', False)]}" data-hotkey="w"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
|
||||
<button name="action_toggle_is_locked"
|
||||
attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}"
|
||||
string="取消阻塞" groups="sf_base.group_sf_mrp_user" type="object"
|
||||
help="Unlock the manufacturing order to adjust what has been consumed or produced."
|
||||
data-hotkey="l"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
|
||||
<button name="action_toggle_is_locked"
|
||||
attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}"
|
||||
string="阻塞" groups="sf_base.group_sf_mrp_user" type="object"
|
||||
help="Lock the manufacturing order to prevent changes to what has been consumed or produced."
|
||||
data-hotkey="l"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='action_serial_mass_produce_wizard']" position="replace">
|
||||
<button name="action_serial_mass_produce_wizard"
|
||||
attrs="{'invisible': [('show_serial_mass_produce', '=', False)]}" string="批量生产"
|
||||
type="object" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//header//button[@name='action_cancel']" position="replace">
|
||||
<button name="action_cancel" type="object" string="取消" data-hotkey="z"
|
||||
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', False)]}"
|
||||
confirm="Some product moves have already been confirmed, this manufacturing order can't be completely cancelled. Are you still sure you want to process ?"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='button_unbuild']" position="replace">
|
||||
<button name="button_unbuild" type="object" string="拆单"
|
||||
attrs="{'invisible': [('state', '!=', 'done')]}" data-hotkey="shift+v"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 工单的操作按钮只让制造用户可见 -->
|
||||
<!-- 工单的操作按钮只让制造用户可见 -->
|
||||
<record id="sf_mrp_production_workorder_tree_editable_view" model="ir.ui.view">
|
||||
<field name="name">sf.mrp.production.workorder.tree.editable</field>
|
||||
<field name="model">mrp.workorder</field>
|
||||
@@ -158,76 +245,111 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree//button[@name='button_start']" position="replace">
|
||||
<button name="button_start" type="object" string="开始" class="btn-success"
|
||||
attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}" groups="sf_base.group_sf_mrp_user"/>
|
||||
attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//tree//button[@name='button_pending']" position="replace">
|
||||
<button name="button_pending" type="object" string="Pause" class="btn-warning"
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//tree//button[@name='button_finish']" position="replace">
|
||||
<button name="button_finish" type="object" string="Done" class="btn-success"
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//tree//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="replace">
|
||||
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="Block"
|
||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//tree//button[@name='button_unblock']" position="replace">
|
||||
<button name="button_unblock" type="object" string="Unblock"
|
||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//tree//button[@name='action_open_wizard']" position="replace">
|
||||
<button name="action_open_wizard" type="object" icon="fa-external-link" class="oe_edit_only"
|
||||
title="Open Work Order"
|
||||
context="{'default_workcenter_id': workcenter_id}" groups="sf_base.group_sf_mrp_user"/>
|
||||
=======
|
||||
<button name="button_start" type="object" string="开始" class="btn-success"
|
||||
attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//tree//button[@name='button_pending']" position="replace">
|
||||
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}" groups="sf_base.group_sf_mrp_user"/>
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//tree//button[@name='button_finish']" position="replace">
|
||||
<button name="button_finish" type="object" string="完成" class="btn-success"
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}" groups="sf_base.group_sf_mrp_user"/>
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//tree//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="replace">
|
||||
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="阻塞" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="阻塞"
|
||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//tree//button[@name='button_unblock']" position="replace">
|
||||
<button name="button_unblock" type="object" string="取消阻塞" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}" groups="sf_base.group_sf_mrp_user"/>
|
||||
<button name="button_unblock" type="object" string="取消阻塞"
|
||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"
|
||||
groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//tree//button[@name='action_open_wizard']" position="replace">
|
||||
<button name="action_open_wizard" type="object" icon="fa-external-link" class="oe_edit_only"
|
||||
title="未完成工单"
|
||||
context="{'default_workcenter_id': workcenter_id}" groups="sf_base.group_sf_mrp_user"/>
|
||||
context="{'default_workcenter_id': workcenter_id}" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 制造订单列表视图header内的按钮只让制造用户可见 -->
|
||||
<record id="sf_mrp_production_tree_view" model="ir.ui.view">
|
||||
<field name="name">sf.mrp.production.tree</field>
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header//button[@name='button_plan']" position="replace">
|
||||
<!-- <button name="button_plan" type="object" string="安排" groups="sf_base.group_sf_mrp_user"/> -->
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
|
||||
<button name="do_unreserve" type="object" string="取消保留" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='action_cancel']" position="replace">
|
||||
<button name="action_cancel" type="object" string="取消" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 制造订单列表视图header内的按钮只让制造用户可见 -->
|
||||
<record id="sf_mrp_production_tree_view" model="ir.ui.view">
|
||||
<field name="name">sf.mrp.production.tree</field>
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header//button[@name='button_plan']" position="replace">
|
||||
<!-- <button name="button_plan" type="object" string="安排" groups="sf_base.group_sf_mrp_user"/> -->
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
|
||||
<button name="do_unreserve" type="object" string="取消保留" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='action_cancel']" position="replace">
|
||||
<button name="action_cancel" type="object" string="取消" groups="sf_base.group_sf_mrp_user"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <record id="custom_mrp_production_form_view" model="ir.ui.view"> -->
|
||||
<!-- <field name="name">custom.mrp.production.form</field> -->
|
||||
<!-- <field name="model">mrp.production</field> -->
|
||||
<!-- <field name="inherit_id" ref="mrp.mrp_production_form_view"/> -->
|
||||
<!-- <field name="arch" type="xml"> -->
|
||||
<!-- <xpath expr="//header//field[@name='state']" position="replace"> -->
|
||||
<!-- <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,已排程,progress,done"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//header" position="inside"> -->
|
||||
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
|
||||
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//sheet//group//group//field[@name='product_id']" position="after"> -->
|
||||
<!-- <field name="production_line_id"/> -->
|
||||
<!-- <field name="date_planned_finished" string="计划结束时间"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//sheet//group//group//field[@name='date_planned_start']" position="after"> -->
|
||||
<!-- <field name="date_planned_finished"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- </field> -->
|
||||
<!-- </record> -->
|
||||
<!-- <record id="custom_mrp_production_form_view" model="ir.ui.view"> -->
|
||||
<!-- <field name="name">custom.mrp.production.form</field> -->
|
||||
<!-- <field name="model">mrp.production</field> -->
|
||||
<!-- <field name="inherit_id" ref="mrp.mrp_production_form_view"/> -->
|
||||
<!-- <field name="arch" type="xml"> -->
|
||||
<!-- <xpath expr="//header//field[@name='state']" position="replace"> -->
|
||||
<!-- <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,已排程,progress,done"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//header" position="inside"> -->
|
||||
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
|
||||
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//sheet//group//group//field[@name='product_id']" position="after"> -->
|
||||
<!-- <field name="production_line_id"/> -->
|
||||
<!-- <field name="date_planned_finished" string="计划结束时间"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//sheet//group//group//field[@name='date_planned_start']" position="after"> -->
|
||||
<!-- <field name="date_planned_finished"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- </field> -->
|
||||
<!-- </record> -->
|
||||
|
||||
<record id="custom_view_mrp_production_filter" model="ir.ui.view">
|
||||
<field name="name">custom.mrp.production.select</field>
|
||||
@@ -243,24 +365,24 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
|
||||
<!-- <filter string="已完成" name="filter_done" domain="[('state', '=', 'done')]"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
|
||||
<!-- <filter string="已取消" name="filter_cancel" domain="[('state', '=', 'cancel')]"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
|
||||
<!-- <filter string="进行中" name="filter_progress" domain="[('state', '=', 'progress')]"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
|
||||
<!-- <filter string="已确认" name="filter_confirmed" domain="[('state', '=', 'confirmed')]"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
|
||||
<!-- <filter string="草稿" name="filter_draft" domain="[('state', '=', 'draft')]"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
|
||||
<!-- <filter string="已完成" name="filter_done" domain="[('state', '=', 'done')]"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
|
||||
<!-- <filter string="已取消" name="filter_cancel" domain="[('state', '=', 'cancel')]"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
|
||||
<!-- <filter string="进行中" name="filter_progress" domain="[('state', '=', 'progress')]"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
|
||||
<!-- <filter string="已确认" name="filter_confirmed" domain="[('state', '=', 'confirmed')]"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
|
||||
<!-- <filter string="草稿" name="filter_draft" domain="[('state', '=', 'draft')]"/> -->
|
||||
<!-- </xpath> -->
|
||||
|
||||
|
||||
<!-- 产品模板修改>>>增加“规格”字段specification_id -->
|
||||
<!-- 产品模板修改>>>增加“规格”字段specification_id -->
|
||||
<record id="custom_product_template_kanban_view" model="ir.ui.view">
|
||||
<field name="name">custom.Product.template.product.kanban</field>
|
||||
<field name="model">product.template</field>
|
||||
@@ -268,44 +390,52 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//kanban" position="replace">
|
||||
<kanban sample="1" class="o_kanban_product_template">
|
||||
<field name="id"/>
|
||||
<field name="product_variant_count"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="activity_state"/>
|
||||
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_card oe_kanban_global_click">
|
||||
<div class="o_kanban_image me-1">
|
||||
<img t-att-src="kanban_image('product.template', 'image_128', record.id.raw_value)" alt="Product" class="o_image_64_contain"/>
|
||||
</div>
|
||||
<div class="oe_kanban_details">
|
||||
<div class="o_kanban_record_top mb-0">
|
||||
<div class="o_kanban_record_headings">
|
||||
<strong class="o_kanban_record_title">
|
||||
<field name="name"/>
|
||||
<field name="id"/>
|
||||
<field name="product_variant_count"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="activity_state"/>
|
||||
<progressbar field="activity_state"
|
||||
colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_card oe_kanban_global_click">
|
||||
<div class="o_kanban_image me-1">
|
||||
<img t-att-src="kanban_image('product.template', 'image_128', record.id.raw_value)"
|
||||
alt="Product" class="o_image_64_contain"/>
|
||||
</div>
|
||||
<div class="oe_kanban_details">
|
||||
<div class="o_kanban_record_top mb-0">
|
||||
<div class="o_kanban_record_headings">
|
||||
<strong class="o_kanban_record_title">
|
||||
<field name="name"/>
|
||||
</strong>
|
||||
</div>
|
||||
<field name="priority" widget="priority"/>
|
||||
</div>
|
||||
|
||||
<div name="product_specification_id" class="mt-1">
|
||||
规格:
|
||||
<field name="specification_id"></field>
|
||||
</div>
|
||||
<t t-if="record.default_code.value">[<field name="default_code"/>]
|
||||
</t>
|
||||
<div t-if="record.product_variant_count.value > 1"
|
||||
groups="product.group_product_variant">
|
||||
<strong>
|
||||
<t t-esc="record.product_variant_count.value"/>
|
||||
Variants
|
||||
</strong>
|
||||
</div>
|
||||
<field name="priority" widget="priority"/>
|
||||
</div>
|
||||
|
||||
<div name="product_specification_id" class="mt-1">
|
||||
规格: <field name="specification_id"></field>
|
||||
</div>
|
||||
<t t-if="record.default_code.value">[<field name="default_code"/>]</t>
|
||||
<div t-if="record.product_variant_count.value > 1" groups="product.group_product_variant">
|
||||
<strong>
|
||||
<t t-esc="record.product_variant_count.value"/> Variants
|
||||
</strong>
|
||||
</div>
|
||||
<div name="product_lst_price" class="mt-1">
|
||||
价格: <field name="list_price" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"></field>
|
||||
<div name="product_lst_price" class="mt-1">
|
||||
价格:
|
||||
<field name="list_price" widget="monetary"
|
||||
options="{'currency_field': 'currency_id', 'field_digits': True}"></field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -117,12 +117,15 @@
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
||||
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工"
|
||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
groups="sf_base.group_sf_mrp_user"
|
||||
groups="sf_base.group_sf_mrp_user" comfirm="请确定是否停工?"
|
||||
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'),('user_permissions','=',False),('name','=','获取CNC加工程序')]}"/>
|
||||
<button name="button_unblock" type="object" string="Unblock"
|
||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||
groups="sf_base.group_sf_mrp_user"
|
||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('name','=','获取CNC加工程序')]}"/>
|
||||
<button name="button_workpiece_delivery" type="object" string="工件配送"
|
||||
attrs="{'invisible': [('routing_type','!=','装夹预调')]}"/>
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
|
||||
@@ -234,11 +237,12 @@
|
||||
<field name="chuck_model_id"/>
|
||||
</group>
|
||||
<group string="托盘">
|
||||
<field name="tray_serial_number"/>
|
||||
<field name="tray_name"/>
|
||||
<field name="tray_brand_id"/>
|
||||
<field name="tray_type_id"/>
|
||||
<field name="tray_model_id"/>
|
||||
<field name="_barcode_scanned" widget="barcode_handler"/>
|
||||
<field name="tray_serial_number" readonly="1" string="序列号"/>
|
||||
<field name="tray_product_id" readonly="1" string="名称"/>
|
||||
<field name="tray_brand_id" readonly="1" string="品牌"/>
|
||||
<field name="tray_type_id" readonly="1" string="类型"/>
|
||||
<field name="tray_model_id" readonly="1" string="型号"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="预调程序信息">
|
||||
@@ -395,10 +399,23 @@
|
||||
</div>
|
||||
|
||||
<group>
|
||||
<field name="material_center_point"/>
|
||||
<field name='X_deviation_angle'/>
|
||||
<field name="material_center_point" readonly="1"/>
|
||||
<field name='X_deviation_angle' readonly="1"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="工件配送" attrs='{"invisible": [("routing_type","!=","装夹预调")]}'>
|
||||
<field name="workpiece_delivery_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="production_id" invisible="1"/>
|
||||
<field name="workpiece_code"/>
|
||||
<field name="feeder_station_start" force_save="1"/>
|
||||
<field name="feeder_station_destination"/>
|
||||
<field name="production_line_id"/>
|
||||
<field name="task_delivery_time"/>
|
||||
<field name="task_completion_time"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
|
||||
</xpath>
|
||||
|
||||
@@ -496,11 +513,11 @@
|
||||
|
||||
<!--=========================================工件配送单列表======================================-->
|
||||
<record id="sf_workpiece_delivery_tree" model="ir.ui.view">
|
||||
<field name="name">工件配送单列表</field>
|
||||
<field name="name">工件配送</field>
|
||||
<field name="model">sf.workpiece.delivery</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="工件配送单列表" editable="bottom">
|
||||
<field name="mrp_workorder_id"/>
|
||||
<tree string="工件配送" editable="bottom">
|
||||
<field name="production_id"/>
|
||||
<field name="workpiece_code"/>
|
||||
<field name="feeder_station_start"/>
|
||||
<field name="production_line_id"/>
|
||||
@@ -514,11 +531,11 @@
|
||||
</record>
|
||||
|
||||
<record id="sf_workpiece_delivery_search" model="ir.ui.view">
|
||||
<field name="name">工件配送单列表</field>
|
||||
<field name="name">工件配送</field>
|
||||
<field name="model">sf.workpiece.delivery</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="工件配送单列表">
|
||||
<field name="mrp_workorder_id"/>
|
||||
<search string="工件配送">
|
||||
<field name="production_id"/>
|
||||
<field name="workpiece_code"/>
|
||||
<field name="feeder_station_start"/>
|
||||
<field name="production_line_id"/>
|
||||
@@ -536,7 +553,7 @@
|
||||
</record>
|
||||
|
||||
<record id="sf_workpiece_delivery_act" model="ir.actions.act_window">
|
||||
<field name="name">工件配送单列表</field>
|
||||
<field name="name">工件配送</field>
|
||||
<field name="res_model">sf.workpiece.delivery</field>
|
||||
<field name="view_mode">tree,search</field>
|
||||
</record>
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_stock_move_operations_inherit_sf" model="ir.ui.view">
|
||||
<field name="name">stock.move.operations.form.inherit.sf</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_operations"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@name='action_assign_serial_show_details']" position="after">
|
||||
<button name="print_serial_numbers" string="序列号打印" type="object"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_picking_form_inherit_sf">
|
||||
<field name="name">stock.picking.form.inherit.sf</field>
|
||||
<field name="model">stock.picking</field>
|
||||
|
||||
@@ -67,6 +67,12 @@ class sf_production_plan(models.Model):
|
||||
sequence = fields.Integer(string='序号', copy=False, readonly=True, index=True)
|
||||
current_operation_name = fields.Char(string='当前工序名称', size=64, default='生产计划')
|
||||
|
||||
@api.onchange('production_line_id')
|
||||
def _compute_production_line_id(self):
|
||||
for item in self:
|
||||
item.production_id.production_line_id = item.production_line_id.id
|
||||
item.production_id.plan_start_processing_time = item.date_planned_start
|
||||
|
||||
@api.onchange('state')
|
||||
def _onchange_state(self):
|
||||
if self.state == 'finished':
|
||||
@@ -324,33 +330,6 @@ class sf_production_plan(models.Model):
|
||||
raise UserError(e)
|
||||
|
||||
|
||||
# # sf生产排程
|
||||
# class sf_produce_plan(models.Model):
|
||||
# _name = 'sf.produce.plan'
|
||||
# _description = 'sf生产排程'
|
||||
|
||||
# # 重写create方法,使得创建坯料预制排程时,如果给出了计划结束时间,则计划开始时间为计划结束时间减去坯料预制时间
|
||||
# @api.model
|
||||
# def create(self, vals):
|
||||
# # 评估结束时间
|
||||
# vals['plan_end_time'] = self._get_plan_end_time(vals['plan_start_time'], vals['quantity'])
|
||||
# return super(sf_pl_plan, self).create(vals)
|
||||
|
||||
# # 当不设置计划结束时间时,增加计算计划结束时间的方法
|
||||
# @api.onchange('plan_start_time', 'quantity')
|
||||
# def _onchange_plan_start_time(self):
|
||||
# if self.plan_start_time and self.quantity:
|
||||
# self.plan_end_time = self._get_plan_end_time(self.plan_start_time, self.quantity)
|
||||
#
|
||||
# # 计算计划结束时间
|
||||
# def _get_plan_end_time(self, plan_start_time, quantity):
|
||||
# # 坯料预制时间
|
||||
# pl_time = 0.5
|
||||
# # 计划结束时间 = 计划开始时间 + 坯料预制时间
|
||||
# plan_end_time = plan_start_time + pl_time
|
||||
# return plan_end_time
|
||||
#
|
||||
|
||||
# 机台作业计划
|
||||
class machine_work_schedule(models.Model):
|
||||
_name = 'sf.machine.schedule'
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
<xpath expr="//form//header//button[@name='action_validate']" position="after">
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
@@ -27,32 +28,33 @@
|
||||
<xpath expr="//form//header//button[@name='action_validate']" position="after">
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 增加权限相关的按钮 -->
|
||||
<!-- <record id="custom_product_template_form_view" model="ir.ui.view"> -->
|
||||
<!-- <field name="name">custom.product.template.form</field> -->
|
||||
<!-- <field name="model">product.template</field> -->
|
||||
<!-- <field name="inherit_id" ref="product.product_template_form_view"/> -->
|
||||
<!-- <field name="arch" type="xml"> -->
|
||||
<!-- <xpath expr="//form//header" position="inside"> -->
|
||||
<!-- <field name="active" invisible="1"/> -->
|
||||
<!-- <field name="check_status" invisible="1"/> -->
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<!-- <button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- </field> -->
|
||||
<!-- </record> -->
|
||||
<!-- <record id="custom_product_template_form_view" model="ir.ui.view"> -->
|
||||
<!-- <field name="name">custom.product.template.form</field> -->
|
||||
<!-- <field name="model">product.template</field> -->
|
||||
<!-- <field name="inherit_id" ref="product.product_template_form_view"/> -->
|
||||
<!-- <field name="arch" type="xml"> -->
|
||||
<!-- <xpath expr="//form//header" position="inside"> -->
|
||||
<!-- <field name="active" invisible="1"/> -->
|
||||
<!-- <field name="check_status" invisible="1"/> -->
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<!-- <button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- </field> -->
|
||||
<!-- </record> -->
|
||||
|
||||
<!-- 增加权限相关的按钮 -->
|
||||
<!-- 增加权限相关的按钮 -->
|
||||
<record id="custom_mrp_bom_form_view" model="ir.ui.view">
|
||||
<field name="name">custom.mrp.bom.form</field>
|
||||
<field name="model">mrp.bom</field>
|
||||
@@ -62,10 +64,12 @@
|
||||
<header>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': [('check_status', '=', True)]}"
|
||||
groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
</header>
|
||||
</xpath>
|
||||
</field>
|
||||
@@ -81,10 +85,12 @@
|
||||
<header>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': [('check_status', '=', True)]}"
|
||||
groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
</header>
|
||||
</xpath>
|
||||
</field>
|
||||
@@ -100,10 +106,12 @@
|
||||
<header>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': [('check_status', '=', True)]}"
|
||||
groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
</header>
|
||||
</xpath>
|
||||
</field>
|
||||
@@ -119,10 +127,12 @@
|
||||
<header>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': [('check_status', '=', True)]}"
|
||||
groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
</header>
|
||||
</xpath>
|
||||
</field>
|
||||
@@ -138,10 +148,12 @@
|
||||
<header>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': [('check_status', '=', True)]}"
|
||||
groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
</header>
|
||||
</xpath>
|
||||
</field>
|
||||
@@ -157,10 +169,12 @@
|
||||
<header>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<button name="action_check" string="审核" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': [('check_status', '=', True)]}"
|
||||
groups="sf_base.group_plan_director"/>
|
||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||
</header>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
@@ -5,13 +5,16 @@
|
||||
<field name="name">sf.production.plan.tree</field>
|
||||
<field name="model">sf.production.plan</field>
|
||||
<field name="arch" type="xml">
|
||||
<!-- <tree string="订单计划" editable="bottom"> -->
|
||||
<!-- <tree string="订单计划" editable="bottom"> -->
|
||||
<tree string="订单计划">
|
||||
<header>
|
||||
<!-- <button name="do_production_schedule" type="object" string="批量排程"/> -->
|
||||
<button string="批量排程" name="%(sf_plan.action_plan_some)d" type="action" class="btn-primary"/>
|
||||
<!-- <button name="do_production_schedule" type="object" string="批量排程"/> -->
|
||||
<button string="批量排程" name="%(sf_plan.action_plan_some)d" type="action"
|
||||
class="btn-primary"/>
|
||||
</header>
|
||||
<field name="state" widget="badge" decoration-warning="state == 'draft'" decoration-success="state == 'done'" decoration-info="state == 'processing'" decoration-danger="state == 'finished'"/>
|
||||
<field name="state" widget="badge" decoration-warning="state == 'draft'"
|
||||
decoration-success="state == 'done'" decoration-info="state == 'processing'"
|
||||
decoration-danger="state == 'finished'"/>
|
||||
<field name="name"/>
|
||||
<field name="origin"/>
|
||||
<field name="order_deadline"/>
|
||||
@@ -20,8 +23,12 @@
|
||||
<field name="date_planned_start"/>
|
||||
<field name="date_planned_finished"/>
|
||||
<field name="schedule_setting"/>
|
||||
<button name="do_production_schedule" class="btn schedule_done" string="生产排程" type="object" attrs="{'invisible': [('state', 'not in', ['draft'])]}" groups="sf_base.group_plan_dispatch"/>
|
||||
<button name="cancel_production_schedule" class="btn schedule_cancel" string="取消排程" type="object" attrs="{'invisible': [('state', 'not in', ['done'])]}" groups="sf_base.group_plan_dispatch"/>
|
||||
<button name="do_production_schedule" class="btn schedule_done" string="生产排程" type="object"
|
||||
attrs="{'invisible': [('state', 'not in', ['draft'])]}"
|
||||
groups="sf_base.group_plan_dispatch"/>
|
||||
<button name="cancel_production_schedule" class="btn schedule_cancel" string="取消排程"
|
||||
type="object" attrs="{'invisible': [('state', 'not in', ['done'])]}"
|
||||
groups="sf_base.group_plan_dispatch"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -32,14 +39,17 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="订单计划">
|
||||
<header>
|
||||
<!-- <button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/> -->
|
||||
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" options='{"calendar_view": true, "date_begin": "2020-01-01", "date_end": "2020-12-31"}' groups="sf_base.group_plan_dispatch" attrs="{'invisible': [('state', '=', 'done')]}"/>
|
||||
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight" groups="sf_base.group_plan_dispatch" attrs="{'invisible': [('state', '=', 'draft')]}"/>
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
<!-- <button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/> -->
|
||||
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight"
|
||||
options='{"calendar_view": true, "date_begin": "2020-01-01", "date_end": "2020-12-31"}'
|
||||
groups="sf_base.group_plan_dispatch" attrs="{'invisible': [('state', '=', 'done')]}"/>
|
||||
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight"
|
||||
groups="sf_base.group_plan_dispatch" attrs="{'invisible': [('state', '=', 'draft')]}"/>
|
||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||
|
||||
<!-- <button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/> -->
|
||||
<!-- <button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/> -->
|
||||
<!-- <button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/> -->
|
||||
<!-- <button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/> -->
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,done,processing,finished"/>
|
||||
</header>
|
||||
<sheet>
|
||||
@@ -68,54 +78,54 @@
|
||||
<field name="shift" widget="time"/>
|
||||
|
||||
<!-- Chatter -->
|
||||
<!-- <div class="oe_chatter"> -->
|
||||
<!-- <field name="message_follower_ids" widget="mail_followers"/> -->
|
||||
<!-- <field name="message_ids" widget="mail_thread"/> -->
|
||||
<!-- <field name="activity_ids"/> -->
|
||||
<!-- </div> -->
|
||||
<!-- <div class="oe_chatter"> -->
|
||||
<!-- <field name="message_follower_ids" widget="mail_followers"/> -->
|
||||
<!-- <field name="message_ids" widget="mail_thread"/> -->
|
||||
<!-- <field name="activity_ids"/> -->
|
||||
<!-- </div> -->
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids"/>
|
||||
<field name="message_ids"/>
|
||||
</div>
|
||||
</group>
|
||||
<!-- <group string="规格信息" col="1"> -->
|
||||
<!-- <group col="3"> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="length"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="width"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="thickness"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- </group> -->
|
||||
<!-- <field name="length"/> -->
|
||||
<!-- <field name="width"/> -->
|
||||
<!-- <field name="thickness"/> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="diameter"/> -->
|
||||
<!-- <field name="material"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group string="绑定订单"> -->
|
||||
<!-- <field name="customer_name"/> -->
|
||||
<!-- <field name="order_no"/> -->
|
||||
<!-- <field name="line_no"/> -->
|
||||
<!-- <field name="delivery_length"/> -->
|
||||
<!-- <field name="delivery_width"/> -->
|
||||
<!-- <field name="delivery_thickness"/> -->
|
||||
<!-- <field name="delivery_diameter"/> -->
|
||||
<!-- <field name="delivery_quantity"/> -->
|
||||
<!-- <field name="delivery_date"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group string="规格信息" col="1"> -->
|
||||
<!-- <group col="3"> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="length"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="width"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="thickness"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- </group> -->
|
||||
<!-- <field name="length"/> -->
|
||||
<!-- <field name="width"/> -->
|
||||
<!-- <field name="thickness"/> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="diameter"/> -->
|
||||
<!-- <field name="material"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group string="绑定订单"> -->
|
||||
<!-- <field name="customer_name"/> -->
|
||||
<!-- <field name="order_no"/> -->
|
||||
<!-- <field name="line_no"/> -->
|
||||
<!-- <field name="delivery_length"/> -->
|
||||
<!-- <field name="delivery_width"/> -->
|
||||
<!-- <field name="delivery_thickness"/> -->
|
||||
<!-- <field name="delivery_diameter"/> -->
|
||||
<!-- <field name="delivery_quantity"/> -->
|
||||
<!-- <field name="delivery_date"/> -->
|
||||
<!-- </group> -->
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 搜索视图 -->
|
||||
<!-- 搜索视图 -->
|
||||
<record id="sf_production_plan_search" model="ir.ui.view">
|
||||
<field name="name">sf.production.plan.search</field>
|
||||
<field name="model">sf.production.plan</field>
|
||||
@@ -151,7 +161,7 @@
|
||||
default_scale="day"
|
||||
scales="day,week,month,year"
|
||||
precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day', 'year': 'month:quarter'}">
|
||||
<field name="shift"/>
|
||||
<field name="shift"/>
|
||||
<field name="name"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="date_planned_start"/>
|
||||
@@ -191,65 +201,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- <record id="sf_pl_plan_action" model="ir.actions.act_window"> -->
|
||||
<!-- <field name="name">制造订单生产计划</field> -->
|
||||
<!-- <field name="type">ir.actions.act_window</field> -->
|
||||
<!-- <field name="res_model">sf.pl.plan</field> -->
|
||||
<!-- <field name="view_mode">tree,form,gantt</field> -->
|
||||
<!-- </record> -->
|
||||
<!-- <record id="sf_production_gantt_view" model="ir.ui.view"> -->
|
||||
<!-- <field name="name">sf.production.plan.gantt</field> -->
|
||||
<!-- <field name="model">mrp.production</field> -->
|
||||
<!-- <field name="arch" type="xml"> -->
|
||||
<!-- <gantt class="o_mrp_workorder_gantt" date_stop="date_planned_finished" date_start="date_planned_start" -->
|
||||
<!-- string="制造订单生产计划" default_group_by="production_line_id" create="0" -->
|
||||
<!-- delete="0" sample="1" plan="0" -->
|
||||
<!-- display_unavailability="1" -->
|
||||
<!-- decoration-success="state == 'done'" -->
|
||||
<!-- decoration-secondary="state == 'cancel'" -->
|
||||
<!-- color="production_line_id" -->
|
||||
<!-- progress_bar="state" -->
|
||||
<!-- form_view_id="mrp.mrp_production_form_view"> -->
|
||||
<!-- <field name="name"/> -->
|
||||
<!-- <field name="product_qty"/> -->
|
||||
<!-- <field name="date_planned_start"/> -->
|
||||
<!-- <field name="date_planned_finished" string="计划结束时间"/> -->
|
||||
<!-- <field name="state"/> -->
|
||||
<!-- <templates> -->
|
||||
<!-- <div t-name="gantt-popover" class="container-fluid"> -->
|
||||
<!-- <div class="row g-0"> -->
|
||||
<!-- <div class="col"> -->
|
||||
<!-- <ul class="ps-1 mb-0 list-unstyled"> -->
|
||||
<!-- <li> -->
|
||||
<!-- <strong>开始时间:</strong> -->
|
||||
<!-- <t t-out="userTimezoneStartDate.format('L LTS')"/> -->
|
||||
<!-- </li> -->
|
||||
<!-- <li> -->
|
||||
<!-- <strong>结束时间:</strong> -->
|
||||
<!-- <t t-out="userTimezoneStopDate.format('L LTS')"/> -->
|
||||
<!-- </li> -->
|
||||
<!-- <li> -->
|
||||
<!-- <strong>数量:</strong> -->
|
||||
<!-- <t t-out="product_qty"/> -->
|
||||
<!-- </li> -->
|
||||
<!-- <li> -->
|
||||
<!-- <strong>状态:</strong> -->
|
||||
<!-- <t t-if="state === 'cancel'">已取消</t> -->
|
||||
<!-- <t t-elif="state === 'done'">已完成</t> -->
|
||||
<!-- <t t-elif="state === '已排程'">已排程</t> -->
|
||||
<!-- <t t-else="">其他状态</t> -->
|
||||
<!-- <t t-out="state"/> -->
|
||||
<!-- </li> -->
|
||||
<!-- </ul> -->
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
<!-- </templates> -->
|
||||
<!-- </gantt> -->
|
||||
<!-- </field> -->
|
||||
<!-- </record> -->
|
||||
|
||||
<record id="sf_machine_schedule_tree" model="ir.ui.view">
|
||||
<field name="name">sf.machine.schedule.tree</field>
|
||||
<field name="model">sf.machine.schedule</field>
|
||||
@@ -268,7 +219,7 @@
|
||||
<field name="view_mode">gantt,tree,form</field>
|
||||
</record>
|
||||
|
||||
<!-- 这个也是制造订单生产计划,只是把tree视图放在了默认位置 -->
|
||||
<!-- 这个也是制造订单生产计划,只是把tree视图放在了默认位置 -->
|
||||
<record id="sf_production_plan_action1" model="ir.actions.act_window">
|
||||
<field name="name">制造订单生产计划</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
@@ -284,11 +235,11 @@
|
||||
groups="sf_base.group_plan_dispatch"
|
||||
/>
|
||||
|
||||
<!-- <record model="ir.ui.menu" id="mrp_custom_menu" inherit_id="mrp.menu_mrp_manufacturing"> -->
|
||||
<!-- <field name="name">Custom Manufacturing Orders</field> -->
|
||||
<!-- <field name="action" ref="mrp.mrp_manufacturing_action"/> -->
|
||||
<!-- --><!-- 扩展现有的动作 --><!-- -->
|
||||
<!-- </record> -->
|
||||
<!-- <record model="ir.ui.menu" id="mrp_custom_menu" inherit_id="mrp.menu_mrp_manufacturing"> -->
|
||||
<!-- <field name="name">Custom Manufacturing Orders</field> -->
|
||||
<!-- <field name="action" ref="mrp.mrp_manufacturing_action"/> -->
|
||||
<!-- --><!-- 扩展现有的动作 --><!-- -->
|
||||
<!-- </record> -->
|
||||
<record model="ir.actions.act_window" id="mrp_custom_action">
|
||||
<!-- 自定义额外的动作 -->
|
||||
<field name="name">制造订单</field>
|
||||
@@ -305,17 +256,17 @@
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_machine_work_schedule">
|
||||
<!-- 自定义额外的动作 -->
|
||||
<!-- 自定义额外的动作 -->
|
||||
<field name="name">机台作业计划</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.machine.schedule</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
暂无机台作业计划
|
||||
暂无机台作业计划
|
||||
</p>
|
||||
<p>
|
||||
跟进请求的处理,并且和合作者沟通。
|
||||
跟进请求的处理,并且和合作者沟通。
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -330,18 +281,18 @@
|
||||
|
||||
<menuitem
|
||||
id="sf_workpiece_delivery_menu"
|
||||
name="工件配送单列表"
|
||||
name="工件配送"
|
||||
sequence="10"
|
||||
action="sf_manufacturing.sf_workpiece_delivery_act"
|
||||
parent="mrp.menu_mrp_manufacturing"
|
||||
/>
|
||||
<!-- <menuitem -->
|
||||
<!-- id="sale_custom_menu" -->
|
||||
<!-- name="报价单" -->
|
||||
<!-- sequence="50" -->
|
||||
<!-- action="sale_custom_action" -->
|
||||
<!-- parent="sf_production_plan_menu" -->
|
||||
<!-- /> -->
|
||||
<!-- <menuitem -->
|
||||
<!-- id="sale_custom_menu" -->
|
||||
<!-- name="报价单" -->
|
||||
<!-- sequence="50" -->
|
||||
<!-- action="sale_custom_action" -->
|
||||
<!-- parent="sf_production_plan_menu" -->
|
||||
<!-- /> -->
|
||||
<menuitem
|
||||
id="schedule_custom_menu"
|
||||
name="排程单"
|
||||
@@ -349,22 +300,6 @@
|
||||
action="sf_production_plan_action1"
|
||||
parent="sf_production_plan_menu"
|
||||
/>
|
||||
<!-- <menuitem -->
|
||||
<!-- id="machine_work_schedule" -->
|
||||
<!-- name="机台作业计划" -->
|
||||
<!-- sequence="200" -->
|
||||
<!-- action="action_machine_work_schedule" -->
|
||||
<!-- parent="sf_production_plan_menu" -->
|
||||
<!-- /> -->
|
||||
|
||||
|
||||
<!-- --><!-- 在现有菜单结构后面加入自定义的动作 -->
|
||||
<!-- <menuitem -->
|
||||
<!-- id="mrp_custom_menuitem" -->
|
||||
<!-- name="My Custom Menuitem" -->
|
||||
<!-- sequence="20" -->
|
||||
<!-- action="mrp_custom_action"/> -->
|
||||
<!-- --><!-- 自定义额外的菜单项 --><!-- -->
|
||||
<!-- </field> -->
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import datetime
|
||||
import logging
|
||||
from odoo import api, fields, models
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.osv import expression
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class SfLocation(models.Model):
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
('location_id', '=', location_dest_id_value),
|
||||
('location_status', '=', '空闲')
|
||||
]"/>
|
||||
<!-- <field name="location_dest_id_product_type"/> -->
|
||||
<!-- <field name="location_dest_id"/> -->
|
||||
<!-- <field name="location_dest_id_product_type"/> -->
|
||||
<!-- <field name="location_dest_id"/> -->
|
||||
<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>
|
||||
</field>
|
||||
</record>
|
||||
@@ -55,26 +55,37 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 原生的按钮对base.user可见,这里修改为对库存用户可见 -->
|
||||
<!-- 原生的按钮对base.user可见,这里修改为对库存用户可见 -->
|
||||
<record id="sf_view_picking_form" model="ir.ui.view">
|
||||
<field name="name">sf.view.picking.form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form//header//button[@name='action_cancel']" position="replace">
|
||||
<button name="action_cancel" attrs="{'invisible': [('state', 'not in', ('assigned', 'confirmed', 'draft', 'waiting'))]}" string="取消" groups="sf_warehouse.group_sf_stock_user" type="object" data-hotkey="z"/>
|
||||
<button name="action_cancel"
|
||||
attrs="{'invisible': [('state', 'not in', ('assigned', 'confirmed', 'draft', 'waiting'))]}"
|
||||
string="取消" groups="sf_warehouse.group_sf_stock_user" type="object" data-hotkey="z"/>
|
||||
</xpath>
|
||||
<xpath expr="//form//header//button[@name='do_unreserve']" position="replace">
|
||||
<button name="do_unreserve" string="取消保留" groups="sf_warehouse.group_sf_stock_user" type="object" attrs="{'invisible': ['|', '|', '|', ('picking_type_code', '=', 'incoming'), ('immediate_transfer', '=', True), '&', ('state', '!=', 'assigned'), ('move_type', '!=', 'one'), '&', ('state', 'not in', ('assigned', 'confirmed')), ('move_type', '=', 'one')]}" data-hotkey="w"/>
|
||||
<button name="do_unreserve" string="取消保留" groups="sf_warehouse.group_sf_stock_user"
|
||||
type="object"
|
||||
attrs="{'invisible': ['|', '|', '|', ('picking_type_code', '=', 'incoming'), ('immediate_transfer', '=', True), '&', ('state', '!=', 'assigned'), ('move_type', '!=', 'one'), '&', ('state', 'not in', ('assigned', 'confirmed')), ('move_type', '=', 'one')]}"
|
||||
data-hotkey="w"/>
|
||||
</xpath>
|
||||
<xpath expr="//form//header//button[@name='button_scrap']" position="replace">
|
||||
<button name="button_scrap" groups="sf_warehouse.group_sf_stock_user" type="object" string="报废" attrs="{'invisible': ['|', '&', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&', ('picking_type_code', '=', 'outgoing'), ('state', '=', 'done')]}" data-hotkey="y"/>
|
||||
<button name="button_scrap" groups="sf_warehouse.group_sf_stock_user" type="object" string="报废"
|
||||
attrs="{'invisible': ['|', '&', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&', ('picking_type_code', '=', 'outgoing'), ('state', '=', 'done')]}"
|
||||
data-hotkey="y"/>
|
||||
</xpath>
|
||||
<xpath expr="//form//header//button[@name='action_assign']" position="replace">
|
||||
<button name="action_assign" attrs="{'invisible': [('show_check_availability', '=', False)]}" string="检查可用量" type="object" class="oe_highlight" groups="sf_warehouse.group_sf_stock_user" data-hotkey="q"/>
|
||||
<button name="action_assign" attrs="{'invisible': [('show_check_availability', '=', False)]}"
|
||||
string="检查可用量" type="object" class="oe_highlight"
|
||||
groups="sf_warehouse.group_sf_stock_user" data-hotkey="q"/>
|
||||
</xpath>
|
||||
<xpath expr="//form//header//button[@name='%(stock.act_stock_return_picking)d']" position="replace">
|
||||
<button name="%(stock.act_stock_return_picking)d" string="退回" attrs="{'invisible': [('state', '!=', 'done')]}" type="action" groups="sf_warehouse.group_sf_stock_user" data-hotkey="k"/>
|
||||
<button name="%(stock.act_stock_return_picking)d" string="退回"
|
||||
attrs="{'invisible': [('state', '!=', 'done')]}" type="action"
|
||||
groups="sf_warehouse.group_sf_stock_user" data-hotkey="k"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
@@ -86,7 +97,9 @@
|
||||
<field name="inherit_id" ref="stock.stock_scrap_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header//button[@name='action_validate']" position="replace">
|
||||
<button name="action_validate" states="draft" string="Validate" type="object" class="oe_highlight" context="{'not_unlink_on_discard': True}" data-hotkey="v" groups="sf_warehouse.group_sf_stock_user"/>
|
||||
<button name="action_validate" states="draft" string="Validate" type="object" class="oe_highlight"
|
||||
context="{'not_unlink_on_discard': True}" data-hotkey="v"
|
||||
groups="sf_warehouse.group_sf_stock_user"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
@@ -97,10 +110,12 @@
|
||||
<field name="inherit_id" ref="stock.vpicktree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
|
||||
<button name="do_unreserve" type="object" string="取消保留" groups="sf_warehouse.group_sf_stock_user"/>
|
||||
<button name="do_unreserve" type="object" string="取消保留"
|
||||
groups="sf_warehouse.group_sf_stock_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='action_assign']" position="replace">
|
||||
<button name="action_assign" type="object" string="检查可用量" groups="sf_warehouse.group_sf_stock_user"/>
|
||||
<button name="action_assign" type="object" string="检查可用量"
|
||||
groups="sf_warehouse.group_sf_stock_user"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -13,20 +13,23 @@ class StockMoveLine(models.Model):
|
||||
picking_location_dest_id = fields.Many2one(related='picking_id.location_dest_id')
|
||||
product_stock_quant_ids = fields.One2many('stock.quant', compute='_compute_product_stock_quant_ids')
|
||||
product_packaging_id = fields.Many2one(related='move_id.product_packaging_id')
|
||||
product_packaging_uom_qty = fields.Float('Packaging Quantity', compute='_compute_product_packaging_uom_qty', help="Quantity of the Packaging in the UoM of the Stock Move Line.")
|
||||
product_packaging_uom_qty = fields.Float('Packaging Quantity', compute='_compute_product_packaging_uom_qty',
|
||||
help="Quantity of the Packaging in the UoM of the Stock Move Line.")
|
||||
is_completed = fields.Boolean(compute='_compute_is_completed', help="Check if the quantity done matches the demand")
|
||||
|
||||
@api.depends('product_id', 'product_id.stock_quant_ids')
|
||||
def _compute_product_stock_quant_ids(self):
|
||||
for line in self:
|
||||
line.product_stock_quant_ids = line.product_id.stock_quant_ids.filtered(lambda q: q.company_id in self.env.companies and q.location_id.usage == 'internal')
|
||||
line.product_stock_quant_ids = line.product_id.stock_quant_ids.filtered(
|
||||
lambda q: q.company_id in self.env.companies and q.location_id.usage == 'internal')
|
||||
|
||||
def _compute_dummy_id(self):
|
||||
self.dummy_id = ''
|
||||
|
||||
def _compute_product_packaging_uom_qty(self):
|
||||
for sml in self:
|
||||
sml.product_packaging_uom_qty = sml.product_packaging_id.product_uom_id._compute_quantity(sml.product_packaging_id.qty, sml.product_uom_id)
|
||||
sml.product_packaging_uom_qty = sml.product_packaging_id.product_uom_id._compute_quantity(
|
||||
sml.product_packaging_id.qty, sml.product_uom_id)
|
||||
|
||||
@api.depends('qty_done')
|
||||
def _compute_is_completed(self):
|
||||
|
||||
@@ -1,201 +1,236 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_stock_move_line_detailed_operation_tree_inherit_quality" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.operations.tree.inherit</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_uom_id']" position="after">
|
||||
<field name="check_state" invisible="1"/>
|
||||
<button type="object" class="btn-info" name="action_open_quality_check_wizard" icon="fa-check"
|
||||
attrs="{'invisible': [('check_state', '!=', 'in_progress')]}" title="Quality Check"/>
|
||||
<button type="object" class="btn-danger" name="action_open_quality_check_wizard" icon="fa-check"
|
||||
attrs="{'invisible': [('check_state', '!=', 'fail')]}" title="Quality Check"/>
|
||||
<button type="object" class="btn-success" name="action_open_quality_check_wizard" icon="fa-check"
|
||||
attrs="{'invisible': [('check_state', '!=', 'pass')]}" title="Quality Check"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_move_line_product_selector" model="ir.ui.view">
|
||||
<field name="name">stock.product.selector</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select a Product" class="o_barcode_line_form flex-column">
|
||||
<div class="row mt-4 mb-4">
|
||||
<field name="company_id" force_save="1" invisible="1"/>
|
||||
<field name="reserved_uom_qty" invisible="1" />
|
||||
<field name="move_id" invisible="1" />
|
||||
<field name="state" invisible="1" />
|
||||
<field name="tracking" invisible="1" />
|
||||
<field name="product_uom_category_id" invisible="1" />
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<record id="stock_move_line_product_selector" model="ir.ui.view">
|
||||
<field name="name">stock.product.selector</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select a Product" class="o_barcode_line_form flex-column">
|
||||
<div class="row mt-4 mb-4">
|
||||
<field name="company_id" force_save="1" invisible="1"/>
|
||||
<field name="reserved_uom_qty" invisible="1"/>
|
||||
<field name="move_id" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="tracking" invisible="1"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
<field name="location_dest_id" invisible="1"/>
|
||||
<div class="col-12 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-tags me-3" title="Product"/>
|
||||
<field name="product_id" placeholder="Product"
|
||||
context="{'default_detailed_type': 'product'}"
|
||||
attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}"
|
||||
domain="[('type', 'in', ['product', 'consu']), '|', ('company_id', '=', False), ('company_id', '=', company_id)]"
|
||||
required="1" nolabel="1"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-cube me-3" title="Quantity"/>
|
||||
<field name="is_completed" invisible="1"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_completed"
|
||||
attrs="{'invisible': [('is_completed', '=', False)]}" options="{'type': 'number'}"
|
||||
placeholder="Quantity"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_not_completed"
|
||||
attrs="{'invisible':[('is_completed', '!=', False)]}" options="{'type': 'number'}"
|
||||
placeholder="Quantity"/>
|
||||
<field name="reserved_uom_qty" widget="set_reserved_qty_button" field_to_set="qty_done"
|
||||
attrs="{'invisible': [('reserved_uom_qty', '=', 0)]}"/>
|
||||
</div>
|
||||
<div class="col-6 my-2 d-flex align-items-baseline" groups="uom.group_uom"
|
||||
attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<i class="fa me-3" attrs="{'invisible': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
<field name="product_uom_id" placeholder="Unit of Measure"
|
||||
options="{'no_open': True}"
|
||||
attrs="{'readonly': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center justify-content-md-start">
|
||||
<div class="col-12 col-sm-10 col-md-8 my-2 ms-md-5 align-items-baseline"
|
||||
attrs="{'invisible': [('tracking', '=', 'serial')]}">
|
||||
<widget name="digipad" quantity_field="qty_done"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_stock_multi_locations">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline"
|
||||
attrs="{'invisible': [('picking_code', '=', 'incoming')]}">
|
||||
<i class="fa fa-fw fa-lg fa-map-marker text-center me-3" title="Source Location"/>
|
||||
<field name="location_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline"
|
||||
attrs="{'invisible': [('picking_code', '=', 'outgoing')]}">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Location"/>
|
||||
<field name="location_dest_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_dest_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-archive me-3" title="Source Package"/>
|
||||
<field name="package_id" placeholder="Source Package"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Package"/>
|
||||
<field name="result_package_id" placeholder="Destination Package"
|
||||
context="{'picking_id': picking_id}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_owner">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-user-o text-center me-3" title="Owner"/>
|
||||
<field name="owner_id" placeholder="Owner"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<field name="tracking" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
<field name="location_dest_id" invisible="1"/>
|
||||
<div class="col-12 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-tags me-3" title="Product"/>
|
||||
<field name="product_id" placeholder="Product"
|
||||
context="{'default_detailed_type': 'product'}"
|
||||
attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}"
|
||||
domain="[('type', 'in', ['product', 'consu']), '|', ('company_id', '=', False), ('company_id', '=', company_id)]"
|
||||
required="1" nolabel="1"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-cube me-3" title="Quantity"/>
|
||||
<field name="is_completed" invisible="1"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_completed" attrs="{'invisible': [('is_completed', '=', False)]}" options="{'type': 'number'}" placeholder="Quantity"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_not_completed" attrs="{'invisible':[('is_completed', '!=', False)]}" options="{'type': 'number'}" placeholder="Quantity"/>
|
||||
<field name="reserved_uom_qty" widget="set_reserved_qty_button" field_to_set="qty_done" attrs="{'invisible': [('reserved_uom_qty', '=', 0)]}"/>
|
||||
</div>
|
||||
<div class="col-6 my-2 d-flex align-items-baseline" groups="uom.group_uom"
|
||||
attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<i class="fa me-3" attrs="{'invisible': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
<field name="product_uom_id" placeholder="Unit of Measure"
|
||||
options="{'no_open': True}"
|
||||
attrs="{'readonly': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center justify-content-md-start">
|
||||
<div class="col-12 col-sm-10 col-md-8 my-2 ms-md-5 align-items-baseline"
|
||||
attrs="{'invisible': [('tracking', '=', 'serial')]}">
|
||||
<widget name="digipad" quantity_field="qty_done"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_stock_multi_locations">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline"
|
||||
attrs="{'invisible': [('picking_code', '=', 'incoming')]}">
|
||||
<i class="fa fa-fw fa-lg fa-map-marker text-center me-3" title="Source Location"/>
|
||||
<field name="location_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline" attrs="{'invisible': [('picking_code', '=', 'outgoing')]}">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Location"/>
|
||||
<field name="location_dest_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_dest_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-archive me-3" title="Source Package"/>
|
||||
<field name="package_id" placeholder="Source Package"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Package"/>
|
||||
<field name="result_package_id" placeholder="Destination Package"
|
||||
context="{'picking_id': picking_id}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_owner">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-user-o text-center me-3" title="Owner"/>
|
||||
<field name="owner_id" placeholder="Owner"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<field name="tracking" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="picking_type_use_create_lots" invisible="1"/>
|
||||
<field name="picking_type_use_existing_lots" invisible="1"/>
|
||||
<field name="picking_location_id" invisible="1"/>
|
||||
<field name="picking_location_dest_id" invisible="1"/>
|
||||
<div class="row" groups="stock.group_production_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-barcode me-3" title="Serial/Lot Number" attrs="{'invisible': [('tracking', 'not in', ['serial', 'lot'])]}"/>
|
||||
<field name="lot_name" placeholder="Serial/Lot Number"
|
||||
attrs="{'invisible': ['|', '|', ('tracking', '=', 'none'), ('picking_type_use_create_lots', '=', False), ('picking_type_use_existing_lots', '=', True)]}"
|
||||
<field name="picking_type_use_create_lots" invisible="1"/>
|
||||
<field name="picking_type_use_existing_lots" invisible="1"/>
|
||||
<field name="picking_location_id" invisible="1"/>
|
||||
<field name="picking_location_dest_id" invisible="1"/>
|
||||
<div class="row" groups="stock.group_production_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-barcode me-3" title="Serial/Lot Number"
|
||||
attrs="{'invisible': [('tracking', 'not in', ['serial', 'lot'])]}"/>
|
||||
<field name="lot_name" placeholder="Serial/Lot Number"
|
||||
attrs="{'invisible': ['|', '|', ('tracking', '=', 'none'), ('picking_type_use_create_lots', '=', False), ('picking_type_use_existing_lots', '=', True)]}"
|
||||
/>
|
||||
<field name="lot_id" placeholder="Serial/Lot Number" options="{'no_open': True}"
|
||||
context="{'default_product_id': product_id, 'default_company_id': company_id}"
|
||||
attrs="{'invisible': ['|', ('tracking', '=', 'none'), ('picking_type_use_existing_lots', '=', False)]}"
|
||||
<field name="lot_id" placeholder="Serial/Lot Number" options="{'no_open': True}"
|
||||
context="{'default_product_id': product_id, 'default_company_id': company_id}"
|
||||
attrs="{'invisible': ['|', ('tracking', '=', 'none'), ('picking_type_use_existing_lots', '=', False)]}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row row-long">
|
||||
<div class="col-12 my-2 d-flex">
|
||||
<i class="fa fa-fw fa-lg fa-cubes me-3" title="Locations"/>
|
||||
<field name="product_stock_quant_ids" context="{'kanban_view_ref': 'stock_barcode.stock_quant_barcode_kanban_2', 'tree_view_ref': 'stock_barcode.view_stock_quant_tree'}"/>
|
||||
<div class="row row-long">
|
||||
<div class="col-12 my-2 d-flex">
|
||||
<i class="fa fa-fw fa-lg fa-cubes me-3" title="Locations"/>
|
||||
<field name="product_stock_quant_ids"
|
||||
context="{'kanban_view_ref': 'stock_barcode.stock_quant_barcode_kanban_2', 'tree_view_ref': 'stock_barcode.view_stock_quant_tree'}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fixed-bottom">
|
||||
<div class="o_barcode_control d-flex">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
<div class="fixed-bottom">
|
||||
<div class="o_barcode_control d-flex">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
</div>
|
||||
<div class="o_barcode_control d-flex" attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<button string="Delete" class="btn btn-danger text-uppercase o_delete"
|
||||
name="unlink" type="object">
|
||||
<i class="fa fa-trash-o"/>
|
||||
Delete
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_barcode_control d-flex" attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<button string="Delete" class="btn btn-danger text-uppercase o_delete"
|
||||
name="unlink" type="object">
|
||||
<i class="fa fa-trash-o"/> Delete
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_quant_barcode_kanban" model="ir.ui.view">
|
||||
<field name="name">stock.barcode.quant.kanban</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban draggable="0">
|
||||
<field name="product_id"/>
|
||||
<field name="quantity"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div>
|
||||
<strong><field name="product_id"/></strong>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="lot_id" groups="stock.group_production_lot"/>
|
||||
<field name="quantity" string="Quantity Done"/>
|
||||
<field name="product_uom_id" string="Unit of Measure" groups="uom.group_uom"/>
|
||||
<record id="stock_quant_barcode_kanban" model="ir.ui.view">
|
||||
<field name="name">stock.barcode.quant.kanban</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban draggable="0">
|
||||
<field name="product_id"/>
|
||||
<field name="quantity"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div>
|
||||
<strong>
|
||||
<field name="product_id"/>
|
||||
</strong>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="lot_id" groups="stock.group_production_lot"/>
|
||||
<field name="quantity" string="Quantity Done"/>
|
||||
<field name="product_uom_id" string="Unit of Measure" groups="uom.group_uom"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_quant_barcode_kanban_2" model="ir.ui.view">
|
||||
<field name="name">stock.quant.kanban.barcode</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click">
|
||||
<div class="mb4">
|
||||
<strong><field name="location_id"/></strong>
|
||||
<record id="stock_quant_barcode_kanban_2" model="ir.ui.view">
|
||||
<field name="name">stock.quant.kanban.barcode</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click">
|
||||
<div class="mb4">
|
||||
<strong>
|
||||
<field name="location_id"/>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="mb4">
|
||||
<field name="quantity"/>
|
||||
<field name="product_uom_id" groups="uom.group_uom"/>
|
||||
<span class="ms-4" attrs="{'invisible': [('lot_id', '=', False)]}"
|
||||
groups="stock.group_production_lot">
|
||||
<field name="lot_id"/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('package_id', '=', False)]}"
|
||||
groups="stock.group_tracking_lot">
|
||||
<i class="fa fa-lg fa-archive" title="Package"/>
|
||||
<field name="package_id"/>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('owner_id', '=', False)]}"
|
||||
groups="stock.group_tracking_owner">
|
||||
<i class="fa fa-lg fa-user-o" title="Owner"/>
|
||||
<field name="owner_id"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb4">
|
||||
<field name="quantity"/> <field name="product_uom_id" groups="uom.group_uom"/>
|
||||
<span class="ms-4" attrs="{'invisible': [('lot_id', '=', False)]}" groups="stock.group_production_lot">
|
||||
<field name="lot_id"/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('package_id', '=', False)]}" groups="stock.group_tracking_lot">
|
||||
<i class="fa fa-lg fa-archive" title="Package"/><field name="package_id"/>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('owner_id', '=', False)]}" groups="stock.group_tracking_owner">
|
||||
<i class="fa fa-lg fa-user-o" title="Owner"/><field name="owner_id"/>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_quant_tree" model="ir.ui.view">
|
||||
<field name="name">stock_barcode.quant.tree.inherit</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_uom_id']" position="attributes" >
|
||||
<attribute name="string">UoM</attribute>
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='available_quantity']" position="attributes" >
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="attributes" >
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_stock_quant_tree" model="ir.ui.view">
|
||||
<field name="name">stock_barcode.quant.tree.inherit</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_uom_id']" position="attributes">
|
||||
<attribute name="string">UoM</attribute>
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='available_quantity']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,181 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo><data>
|
||||
<record id="view_stock_move_line_detailed_operation_tree_inherit_stock_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.operations.tree.inherit</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="inside">
|
||||
<field name="product_barcode" invisible="1"/>
|
||||
<field name="location_processed" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='qty_done']" position="attributes">
|
||||
<attribute name="options">{'barcode_events': True}</attribute>
|
||||
<attribute name="widget">field_float_scannable</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_stock_move_line_kanban_inherited" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.kanban.inherited</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='qty_done']" position="after">
|
||||
<field name="product_barcode" invisible="1"/>
|
||||
<field name="location_processed" invisible="1"/>
|
||||
<field name="result_package_id" invisible="1"/>
|
||||
<field name="lots_visible" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_move_line_kanban_inherited" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.kanban.inherited</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='qty_done']" position="after">
|
||||
<field name="product_barcode" invisible="1"/>
|
||||
<field name="location_processed" invisible="1"/>
|
||||
<field name="result_package_id" invisible="1"/>
|
||||
<field name="lots_visible" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_picking_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.form.view.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Picking Details">
|
||||
<field name="show_allocation" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<group>
|
||||
<button name="action_view_reception_report" string="Allocation" type="object"
|
||||
context="{'default_picking_ids': [id]}"
|
||||
class="btn btn-primary o_reception_report" icon="fa-list"
|
||||
attrs="{'invisible': [('show_allocation', '=', False)]}"
|
||||
groups="stock.group_reception_report"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="scheduled_date" readonly="1" attrs="{'invisible': [('scheduled_date', '=', False)]}"/>
|
||||
<field name="origin" readonly="1" attrs="{'invisible': [('origin', '=', False)]}"/>
|
||||
<field name="state" readonly="1" attrs="{'invisible': [('state', '=', False)]}"/>
|
||||
<field name="priority" readonly="1" attrs="{'invisible': [('priority', '=', False)]}"/>
|
||||
<field name="owner_id" readonly="1" attrs="{'invisible': [('owner_id', '=', False)]}" groups="stock.group_tracking_owner"/>
|
||||
<field name="company_id" readonly="1" groups="base.group_multi_company"/>
|
||||
<field name="move_ids" readonly="1" attrs="{'invisible': [('move_ids', '=', False)]}">
|
||||
<kanban>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
<div class="row">
|
||||
<div class="col-6 o_kanban_record_title">
|
||||
<field name="product_id"/>
|
||||
<record id="stock_picking_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.form.view.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Picking Details">
|
||||
<field name="show_allocation" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<group>
|
||||
<button name="action_view_reception_report" string="Allocation" type="object"
|
||||
context="{'default_picking_ids': [id]}"
|
||||
class="btn btn-primary o_reception_report" icon="fa-list"
|
||||
attrs="{'invisible': [('show_allocation', '=', False)]}"
|
||||
groups="stock.group_reception_report"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="scheduled_date" readonly="1"
|
||||
attrs="{'invisible': [('scheduled_date', '=', False)]}"/>
|
||||
<field name="origin" readonly="1" attrs="{'invisible': [('origin', '=', False)]}"/>
|
||||
<field name="state" readonly="1" attrs="{'invisible': [('state', '=', False)]}"/>
|
||||
<field name="priority" readonly="1" attrs="{'invisible': [('priority', '=', False)]}"/>
|
||||
<field name="owner_id" readonly="1" attrs="{'invisible': [('owner_id', '=', False)]}"
|
||||
groups="stock.group_tracking_owner"/>
|
||||
<field name="company_id" readonly="1" groups="base.group_multi_company"/>
|
||||
<field name="move_ids" readonly="1" attrs="{'invisible': [('move_ids', '=', False)]}">
|
||||
<kanban>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
<div class="row">
|
||||
<div class="col-6 o_kanban_record_title">
|
||||
<field name="product_id"/>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="product_uom_qty"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="product_uom_qty"/>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="description_picking"/>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="state"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="description_picking"/>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="state"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
<field name="note" readonly="1" attrs="{'invisible': [('note', '=', False)]}"/>
|
||||
</group>
|
||||
<div class="o_barcode_control d-flex fixed-bottom">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
<field name="note" readonly="1" attrs="{'invisible': [('note', '=', False)]}"/>
|
||||
</group>
|
||||
<div class="o_barcode_control d-flex fixed-bottom">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="open_picking" model="ir.actions.act_window">
|
||||
<field name="name">Open picking form</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="context">{
|
||||
'res_id': active_id,
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
<record id="open_picking" model="ir.actions.act_window">
|
||||
<field name="name">Open picking form</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="context">{
|
||||
'res_id': active_id,
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="picking_view_kanban_inherit_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.view.kanban.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.stock_picking_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<record id="picking_view_kanban_inherit_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.view.kanban.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.stock_picking_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<!-- Use the form view -->
|
||||
<xpath expr="//div[hasclass('o_kanban_record_headings')]" position="after">
|
||||
<button style="padding: 0px 10px;" class="btn btn-link fa fa-desktop" title="Open picking" name="action_open_picking" type="object"/>
|
||||
</xpath>
|
||||
<!-- Use the form view -->
|
||||
<xpath expr="//div[hasclass('o_kanban_record_headings')]" position="after">
|
||||
<button style="padding: 0px 10px;" class="btn btn-link fa fa-desktop" title="Open picking"
|
||||
name="action_open_picking" type="object"/>
|
||||
</xpath>
|
||||
|
||||
<!-- Use mobile view-->
|
||||
<xpath expr="//strong[hasclass('o_kanban_record_title')]" position="replace">
|
||||
<button style="padding: 0px 0px;" class="btn btn-link o_kanban_record_title" name="action_open_picking_client_action"
|
||||
type="object">
|
||||
<span><t t-esc="record.name.value"/></span>
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Use mobile view-->
|
||||
<xpath expr="//strong[hasclass('o_kanban_record_title')]" position="replace">
|
||||
<button style="padding: 0px 0px;" class="btn btn-link o_kanban_record_title"
|
||||
name="action_open_picking_client_action"
|
||||
type="object">
|
||||
<span>
|
||||
<t t-esc="record.name.value"/>
|
||||
</span>
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_type_form_inherit_stock_barcode" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='warehouse_id']" position="after">
|
||||
<field name="barcode"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_picking_type_form_inherit_stock_barcode" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='warehouse_id']" position="after">
|
||||
<field name="barcode"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_barcode_view_picking_type_form" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet//group[@name='first']" position="before">
|
||||
<notebook>
|
||||
<page name="general" string="General">
|
||||
</page>
|
||||
<page name="barcode_app" string="Barcode App">
|
||||
<group name="restrict_scan_settings" string="Mandatory Scan">
|
||||
<field name="restrict_scan_source_location" string="Source Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'incoming')]}"/>
|
||||
<field name="restrict_scan_product" string="Product"/>
|
||||
<field name="restrict_scan_tracking_number" string="Lot/Serial"
|
||||
groups="stock.group_production_lot"/>
|
||||
<field name="restrict_put_in_pack"
|
||||
groups="stock.group_tracking_lot" string="Put in Pack"/>
|
||||
<field name="restrict_scan_dest_location" string="Destination Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'outgoing')]}"/>
|
||||
</group>
|
||||
<field name="show_barcode_validation" invisible="1"/>
|
||||
<group name="barcode_validation" string="Final Validation" attrs="{'invisible': [('show_barcode_validation', '=', False)]}">
|
||||
<!-- show_barcode_validation handles combined groups/invisible complexity -->
|
||||
<field name="barcode_validation_full"
|
||||
attrs="{'invisible': [('restrict_scan_product', '=', True)]}"/>
|
||||
<field name="barcode_validation_all_product_packed"
|
||||
groups="stock.group_tracking_lot"
|
||||
attrs="{'invisible': [('restrict_put_in_pack', '!=', 'optional')]}"/>
|
||||
<field name="barcode_validation_after_dest_location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': ['|',
|
||||
<record id="stock_barcode_view_picking_type_form" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet//group[@name='first']" position="before">
|
||||
<notebook>
|
||||
<page name="general" string="General">
|
||||
</page>
|
||||
<page name="barcode_app" string="Barcode App">
|
||||
<group name="restrict_scan_settings" string="Mandatory Scan">
|
||||
<field name="restrict_scan_source_location" string="Source Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'incoming')]}"/>
|
||||
<field name="restrict_scan_product" string="Product"/>
|
||||
<field name="restrict_scan_tracking_number" string="Lot/Serial"
|
||||
groups="stock.group_production_lot"/>
|
||||
<field name="restrict_put_in_pack"
|
||||
groups="stock.group_tracking_lot" string="Put in Pack"/>
|
||||
<field name="restrict_scan_dest_location" string="Destination Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'outgoing')]}"/>
|
||||
</group>
|
||||
<field name="show_barcode_validation" invisible="1"/>
|
||||
<group name="barcode_validation" string="Final Validation"
|
||||
attrs="{'invisible': [('show_barcode_validation', '=', False)]}">
|
||||
<!-- show_barcode_validation handles combined groups/invisible complexity -->
|
||||
<field name="barcode_validation_full"
|
||||
attrs="{'invisible': [('restrict_scan_product', '=', True)]}"/>
|
||||
<field name="barcode_validation_all_product_packed"
|
||||
groups="stock.group_tracking_lot"
|
||||
attrs="{'invisible': [('restrict_put_in_pack', '!=', 'optional')]}"/>
|
||||
<field name="barcode_validation_after_dest_location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': ['|',
|
||||
('code', '=', 'outgoing'),
|
||||
('restrict_scan_dest_location', '!=', 'optional'),
|
||||
]}"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='first']" position="move"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='second']" position="move"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data></odoo>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='first']" position="move"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='second']" position="move"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user