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:
杨金灵
2024-01-30 09:44:40 +08:00
committed by Coding
16 changed files with 1039 additions and 999 deletions

View File

@@ -1,40 +1,72 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink 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,sf_machine_tool,model_sf_machine_tool,base.group_user,1,1,1,0
access_sf_machine_tool_type,sf_machine_tool_type,model_sf_machine_tool_type,base.group_user,1,1,1,1 access_sf_machine_tool_admin,sf_machine_tool_admin,model_sf_machine_tool,base.group_system,1,1,1,0
access_sf_machine_brand,sf_machine_brand,model_sf_machine_brand,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,0
access_sf_machine_brand_tags,sf_machine_brand_tags,model_sf_machine_brand_tags,base.group_user,1,1,1,1 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_control_system,sf_machine_control_system,model_sf_machine_control_system,base.group_user,1,1,1,1 access_sf_machine_brand,sf_machine_brand,model_sf_machine_brand,base.group_user,1,1,1,0
access_sf_processing_order,sf_processing_order,model_sf_processing_order,base.group_user,1,1,1,1 access_sf_machine_brand_admin,sf_machine_brand_admin,model_sf_machine_brand,base.group_system,1,1,1,0
access_sf_production_process,sf_production_process,model_sf_production_process,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,0
access_sf_production_materials,sf_production_materials,model_sf_production_materials,base.group_user,1,1,1,1 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_materials_model,sf_materials_model,model_sf_materials_model,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,0
access_sf_processing_technology,sf_processing_technology,model_sf_processing_technology,base.group_user,1,1,1,1 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_supplier_sort,sf_supplier_sort,model_sf_supplier_sort,base.group_user,1,1,1,1 access_sf_processing_order,sf_processing_order,model_sf_processing_order,base.group_user,1,1,1,0
access_sf_production_process_parameter,sf_production_process_parameter,model_sf_production_process_parameter,base.group_user,1,1,1,1 access_sf_processing_order_admin,sf_processing_order_admin,model_sf_processing_order,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,1 access_sf_production_process,sf_production_process,model_sf_production_process,base.group_user,1,1,1,0
access_sf_machine_tool_category,sf_machine_tool_category,model_sf_machine_tool_category,base.group_user,1,1,1,1 access_sf_production_process_admin,sf_production_process_admin,model_sf_production_process,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,1 access_sf_production_materials,sf_production_materials,model_sf_production_materials,base.group_user,1,1,1,0
access_sf_cutting_tool_type,sf_cutting_tool_type,model_sf_cutting_tool_type,base.group_user,1,1,1,1 access_sf_production_materials_admin,sf_production_materials_admin,model_sf_production_materials,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,1 access_sf_materials_model,sf_materials_model,model_sf_materials_model,base.group_user,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,1 access_sf_materials_model_admin,sf_materials_model_admin,model_sf_materials_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,1 access_sf_processing_technology,sf_processing_technology,model_sf_processing_technology,base.group_user,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,1 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_multi_mounting_type,sf_multi_mounting_type,model_sf_multi_mounting_type,base.group_user,1,1,1,1 access_sf_supplier_sort_admin,sf_supplier_sort_admin,model_sf_supplier_sort,base.group_system,1,1,1,0
access_sf_fixture_model,sf_fixture_model,model_sf_fixture_model,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,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_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_functional_fixture_type_admin,sf_functional_fixture_type_admin,model_sf_functional_fixture_type,base.group_system,1,1,1,0
access_sf_sync_common,sf_sync_common,model_sf_sync_common,base.group_user,1,1,1,1 access_sf_functional_fixture,sf_functional_fixture,model_sf_functional_fixture,base.group_user,1,1,1,0
access_sf_international_standards,sf_international_standards,model_sf_international_standards,base.group_user,1,1,1,1 access_sf_functional_fixture_admin,sf_functional_fixture_admin,model_sf_functional_fixture,base.group_system,1,1,1,0
access_material_apply,material_apply,model_material_apply,base.group_user,1,1,1,1 access_sf_sync_common,sf_sync_common,model_sf_sync_common,base.group_user,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,1 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_tool_materials_basic_parameters,sf_tool_materials_basic_parameters,model_sf_tool_materials_basic_parameters,base.group_user,1,1,1,1 access_sf_international_standards_admin,sf_international_standards_admin,model_sf_international_standards,base.group_system,1,1,1,0
access_sf_cutting_speed,sf_cutting_speed,model_sf_cutting_speed,base.group_user,1,1,1,1 access_material_apply,material_apply,model_material_apply,base.group_user,1,1,1,0
access_sf_feed_per_tooth,sf_feed_per_tooth,model_sf_feed_per_tooth,base.group_user,1,1,1,1 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,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,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,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_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 access_sf_machine_brand,sf_machine_brand,model_sf_machine_brand,sf_base.group_sf_mrp_user,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_sf_machine_tool sf_machine_tool model_sf_machine_tool base.group_user 1 1 1 1 0
3 access_sf_machine_tool_type access_sf_machine_tool_admin sf_machine_tool_type sf_machine_tool_admin model_sf_machine_tool_type model_sf_machine_tool base.group_user base.group_system 1 1 1 1 0
4 access_sf_machine_brand access_sf_machine_tool_type sf_machine_brand sf_machine_tool_type model_sf_machine_brand model_sf_machine_tool_type base.group_user 1 1 1 1 0
5 access_sf_machine_brand_tags access_sf_machine_tool_type_admin sf_machine_brand_tags sf_machine_tool_type_admin model_sf_machine_brand_tags model_sf_machine_tool_type base.group_user base.group_system 1 1 1 1 0
6 access_sf_machine_control_system access_sf_machine_brand sf_machine_control_system sf_machine_brand model_sf_machine_control_system model_sf_machine_brand base.group_user 1 1 1 1 0
7 access_sf_processing_order access_sf_machine_brand_admin sf_processing_order sf_machine_brand_admin model_sf_processing_order model_sf_machine_brand base.group_user base.group_system 1 1 1 1 0
8 access_sf_production_process access_sf_machine_brand_tags sf_production_process sf_machine_brand_tags model_sf_production_process model_sf_machine_brand_tags base.group_user 1 1 1 1 0
9 access_sf_production_materials access_sf_machine_brand_tags_admin sf_production_materials sf_machine_brand_tags_admin model_sf_production_materials model_sf_machine_brand_tags base.group_user base.group_system 1 1 1 1 0
10 access_sf_materials_model access_sf_machine_control_system sf_materials_model sf_machine_control_system model_sf_materials_model model_sf_machine_control_system base.group_user 1 1 1 1 0
11 access_sf_processing_technology access_sf_machine_control_system_admin sf_processing_technology sf_machine_control_system_admin model_sf_processing_technology model_sf_machine_control_system base.group_user base.group_system 1 1 1 1 0
12 access_sf_supplier_sort access_sf_processing_order sf_supplier_sort sf_processing_order model_sf_supplier_sort model_sf_processing_order base.group_user 1 1 1 1 0
13 access_sf_production_process_parameter access_sf_processing_order_admin sf_production_process_parameter sf_processing_order_admin model_sf_production_process_parameter model_sf_processing_order base.group_user base.group_system 1 1 1 1 0
14 access_sf_production_process_category access_sf_production_process sf_production_process_category sf_production_process model_sf_production_process_category model_sf_production_process base.group_user 1 1 1 1 0
15 access_sf_machine_tool_category access_sf_production_process_admin sf_machine_tool_category sf_production_process_admin model_sf_machine_tool_category model_sf_production_process base.group_user base.group_system 1 1 1 1 0
16 access_sf_cutting_tool_material access_sf_production_materials sf_cutting_tool_material sf_production_materials model_sf_cutting_tool_material model_sf_production_materials base.group_user 1 1 1 1 0
17 access_sf_cutting_tool_type access_sf_production_materials_admin sf_cutting_tool_type sf_production_materials_admin model_sf_cutting_tool_type model_sf_production_materials base.group_user base.group_system 1 1 1 1 0
18 access_sf_functional_cutting_tool access_sf_materials_model sf_functional_cutting_tool sf_materials_model model_sf_functional_cutting_tool model_sf_materials_model base.group_user 1 1 1 1 0
19 access_sf_functional_cutting_tool_model access_sf_materials_model_admin sf_functional_cutting_tool_model sf_materials_model_admin model_sf_functional_cutting_tool_model model_sf_materials_model base.group_user base.group_system 1 1 1 1 0
20 access_sf_fixture_material access_sf_processing_technology sf_fixture_material sf_processing_technology model_sf_fixture_material model_sf_processing_technology base.group_user 1 1 1 1 0
21 access_sf_fixture_materials_basic_parameters access_sf_processing_technology_admin sf_fixture_materials_basic_parameters sf_processing_technology_admin model_sf_fixture_materials_basic_parameters model_sf_processing_technology base.group_user base.group_system 1 1 1 1 0
22 access_sf_multi_mounting_type access_sf_supplier_sort sf_multi_mounting_type sf_supplier_sort model_sf_multi_mounting_type model_sf_supplier_sort base.group_user 1 1 1 1 0
23 access_sf_fixture_model access_sf_supplier_sort_admin sf_fixture_model sf_supplier_sort_admin model_sf_fixture_model model_sf_supplier_sort base.group_user base.group_system 1 1 1 1 0
24 access_sf_functional_fixture_type access_sf_production_process_parameter sf_functional_fixture_type sf_production_process_parameter model_sf_functional_fixture_type model_sf_production_process_parameter base.group_user 1 1 1 1 0
25 access_sf_production_process_parameter_admin sf_production_process_parameter_admin model_sf_production_process_parameter base.group_system 1 1 1 0
26 access_sf_production_process_category sf_production_process_category model_sf_production_process_category base.group_user 1 1 1 0
27 access_sf_production_process_category_admin sf_production_process_category_admin model_sf_production_process_category base.group_system 1 1 1 0
28 access_sf_machine_tool_category sf_machine_tool_category model_sf_machine_tool_category base.group_user 1 1 1 0
29 access_sf_machine_tool_category_admin sf_machine_tool_category_admin model_sf_machine_tool_category base.group_system 1 1 1 0
30 access_sf_cutting_tool_material sf_cutting_tool_material model_sf_cutting_tool_material base.group_user 1 1 1 0
31 access_sf_cutting_tool_material_admin sf_cutting_tool_material_admin model_sf_cutting_tool_material base.group_system 1 1 1 0
32 access_sf_cutting_tool_type sf_cutting_tool_type model_sf_cutting_tool_type base.group_user 1 1 1 0
33 access_sf_cutting_tool_type_admin sf_cutting_tool_type_admin model_sf_cutting_tool_type base.group_system 1 1 1 0
34 access_sf_functional_cutting_tool sf_functional_cutting_tool model_sf_functional_cutting_tool base.group_user 1 1 1 0
35 access_sf_functional_cutting_tool_admin sf_functional_cutting_tool_admin model_sf_functional_cutting_tool base.group_system 1 1 1 0
36 access_sf_functional_cutting_tool_model sf_functional_cutting_tool_model model_sf_functional_cutting_tool_model base.group_user 1 1 1 0
37 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
38 access_sf_fixture_material sf_fixture_material model_sf_fixture_material base.group_user 1 1 1 0
39 access_sf_fixture_material_admin sf_fixture_material_admin model_sf_fixture_material base.group_system 1 1 1 0
40 access_sf_fixture_materials_basic_parameters sf_fixture_materials_basic_parameters model_sf_fixture_materials_basic_parameters base.group_user 1 1 1 0
41 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
42 access_sf_multi_mounting_type sf_multi_mounting_type model_sf_multi_mounting_type base.group_user 1 1 1 0
43 access_sf_multi_mounting_type_admin sf_multi_mounting_type_admin model_sf_multi_mounting_type base.group_system 1 1 1 0
44 access_sf_fixture_model sf_fixture_model model_sf_fixture_model base.group_user 1 1 1 0
45 access_sf_fixture_model_admin sf_fixture_model_admin model_sf_fixture_model base.group_system 1 1 1 0
46 access_sf_functional_fixture access_sf_functional_fixture_type sf_functional_fixture sf_functional_fixture_type model_sf_functional_fixture model_sf_functional_fixture_type base.group_user 1 1 1 1
47 access_sf_sync_common access_sf_functional_fixture_type_admin sf_sync_common sf_functional_fixture_type_admin model_sf_sync_common model_sf_functional_fixture_type base.group_user base.group_system 1 1 1 1 0
48 access_sf_international_standards access_sf_functional_fixture sf_international_standards sf_functional_fixture model_sf_international_standards model_sf_functional_fixture base.group_user 1 1 1 1 0
49 access_material_apply access_sf_functional_fixture_admin material_apply sf_functional_fixture_admin model_material_apply model_sf_functional_fixture base.group_user base.group_system 1 1 1 1 0
50 access_sf_cutting_tool_standard_library access_sf_sync_common sf_cutting_tool_standard_library sf_sync_common model_sf_cutting_tool_standard_library model_sf_sync_common base.group_user 1 1 1 1 0
51 access_sf_tool_materials_basic_parameters access_sf_sync_common sf_tool_materials_basic_parameters sf_sync_common_admin model_sf_tool_materials_basic_parameters model_sf_sync_common_admin base.group_user base.group_system 1 1 1 1 0
52 access_sf_cutting_speed access_sf_international_standards sf_cutting_speed sf_international_standards model_sf_cutting_speed model_sf_international_standards base.group_user 1 1 1 1 0
53 access_sf_feed_per_tooth access_sf_international_standards_admin sf_feed_per_tooth sf_international_standards_admin model_sf_feed_per_tooth model_sf_international_standards base.group_user base.group_system 1 1 1 1 0
54 access_sf_ramping_angle access_material_apply sf_ramping_angle material_apply model_sf_ramping_angle model_material_apply base.group_user 1 1 1 1 0
55 access_sf_cutting_width_depth access_material_apply_admin sf_cutting_width_depth material_apply_admin model_sf_cutting_width_depth model_material_apply base.group_user base.group_system 1 1 1 1 0
56 access_sf_cutting_tool_standard_library sf_cutting_tool_standard_library model_sf_cutting_tool_standard_library base.group_user 1 1 1 0
57 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
58 access_sf_tool_materials_basic_parameters sf_tool_materials_basic_parameters model_sf_tool_materials_basic_parameters base.group_user 1 1 1 0
59 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
60 access_sf_cutting_speed sf_cutting_speed model_sf_cutting_speed base.group_user 1 1 1 0
61 access_sf_cutting_speed_admin sf_cutting_speed_admin model_sf_cutting_speed base.group_system 1 1 1 0
62 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
63 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
64 access_sf_feed_per_tooth sf_feed_per_tooth model_sf_feed_per_tooth base.group_user 1 1 1 0
65 access_sf_feed_per_tooth_admin sf_feed_per_tooth_admin model_sf_feed_per_tooth base.group_system 1 1 1 0
66 access_sf_machine_tool access_sf_ramping_angle sf_machine_tool sf_ramping_angle model_sf_machine_tool model_sf_ramping_angle sf_base.group_sf_mrp_user base.group_user 1 0 1 0 1 0 1
67 access_sf_ramping_angle_admin sf_ramping_angle_admin model_sf_ramping_angle base.group_system 1 1 1 1
68 access_sf_machine_tool_type access_sf_cutting_width_depth sf_machine_tool_type sf_cutting_width_depth model_sf_machine_tool_type model_sf_cutting_width_depth sf_base.group_sf_mrp_user base.group_user 1 0 1 0 1 0 1
69 access_sf_machine_brand access_sf_cutting_width_depth_admin sf_machine_brand sf_cutting_width_depth_admin model_sf_machine_brand model_sf_cutting_width_depth sf_base.group_sf_mrp_user base.group_system 1 0 1 0 1 0 1
70 access_sf_machine_brand_tags access_sf_machine_tool sf_machine_brand_tags sf_machine_tool model_sf_machine_brand_tags model_sf_machine_tool base.group_user sf_base.group_sf_mrp_user 1 1 0 1 0 1 0
71 access_sf_machine_control_system access_sf_machine_tool_type sf_machine_control_system sf_machine_tool_type model_sf_machine_control_system model_sf_machine_tool_type sf_base.group_sf_mrp_user 1 0 0 0
72 access_sf_processing_order access_sf_machine_brand sf_processing_order sf_machine_brand model_sf_processing_order model_sf_machine_brand sf_base.group_sf_mrp_user 1 0 0 0

View File

@@ -50,6 +50,9 @@ class MrpProduction(models.Model):
work_state = fields.Char('业务状态') work_state = fields.Char('业务状态')
programming_state = fields.Char('编程状态') programming_state = fields.Char('编程状态')
glb_file = fields.Binary("glb模型文件") glb_file = fields.Binary("glb模型文件")
production_line_id = fields.Many2one('sf.production.line', string='生产线')
plan_start_processing_time = fields.Datetime('计划开始加工时间')
@api.depends( @api.depends(
'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state', '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 # if completed products make other confirmed/partially_available moves available, assign them
done_move_finished_ids = ( 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') lambda m: m.state == 'done')
done_move_finished_ids._trigger_assign() done_move_finished_ids._trigger_assign()

View File

@@ -122,15 +122,16 @@ class ResMrpWorkOrder(models.Model):
chuck_type_id = fields.Char(string="卡盘类型") chuck_type_id = fields.Char(string="卡盘类型")
chuck_model_id = fields.Char(string="卡盘型号") chuck_model_id = fields.Char(string="卡盘型号")
tray_serial_number = 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_brand_id = fields.Many2one('sf.machine.brand', string="托盘品牌")
tray_type_id = fields.Char(string="托盘类型") tray_type_id = fields.Many2one('sf.fixture.material', string="托盘类型")
tray_model_id = fields.Char(string="托盘型号") tray_model_id = fields.Many2one('sf.fixture.model', string="托盘型号")
total_wight = fields.Float(string="总重量") total_wight = fields.Float(string="总重量")
maximum_carrying_weight = fields.Char(string="最大承载重量[kg]") maximum_carrying_weight = fields.Char(string="最大承载重量[kg]")
maximum_clamping_force = fields.Char(string="最大夹持力[n]") maximum_clamping_force = fields.Char(string="最大夹持力[n]")
production_line = fields.Char(string="生产线") production_line = fields.Char(string="生产线")
preset_program_information = fields.Char(string="预调程序信息") preset_program_information = fields.Char(string="预调程序信息")
workpiece_delivery_ids = fields.One2many('sf.workpiece.delivery', 'workorder_id', '工件配送')
@api.onchange('is_ok') @api.onchange('is_ok')
def _onchange_inspection_user_id(self): def _onchange_inspection_user_id(self):
@@ -195,9 +196,24 @@ class ResMrpWorkOrder(models.Model):
work = workorder.production_id.workorder_ids work = workorder.production_id.workorder_ids
work.compensation_value_x = eval(self.material_center_point)[0] work.compensation_value_x = eval(self.material_center_point)[0]
work.compensation_value_y = eval(self.material_center_point)[1] work.compensation_value_y = eval(self.material_center_point)[1]
workorder.button_finish()
except: except:
raise UserError("参数计算有误") 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): def json_workorder_str(self, k, production, route):
# 计算预计时长duration_expected # 计算预计时长duration_expected
@@ -240,7 +256,9 @@ class ResMrpWorkOrder(models.Model):
'date_planned_finished': False, 'date_planned_finished': False,
'duration_expected': duration_expected, 'duration_expected': duration_expected,
'duration': 0, '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 return workorders_values_str
@@ -551,6 +569,9 @@ class ResMrpWorkOrder(models.Model):
raise UserError(_('请先完成上一步工单')) raise UserError(_('请先完成上一步工单'))
def button_finish(self): 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: if self.picking_out_id:
picking_out = self.env['stock.picking'].search([('id', '=', self.picking_out_id.id)]) picking_out = self.env['stock.picking'].search([('id', '=', self.picking_out_id.id)])
if picking_out.workorder_out_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: for move_raw_id in self.production_id.move_raw_ids:
move_raw_id.quantity_done = move_raw_id.product_uom_qty move_raw_id.quantity_done = move_raw_id.product_uom_qty
self.production_id.button_mark_done1() self.production_id.button_mark_done1()
# self.production_id.state = 'done' # self.production_id.state = 'done'
class CNCprocessing(models.Model): class CNCprocessing(models.Model):
@@ -724,73 +741,71 @@ class SfWorkOrderBarcodes(models.Model):
_name = "mrp.workorder" _name = "mrp.workorder"
_inherit = ["mrp.workorder", "barcodes.barcode_events_mixin"] _inherit = ["mrp.workorder", "barcodes.barcode_events_mixin"]
# def on_barcode_scanned(self, barcode): def on_barcode_scanned(self, barcode):
# workorder = self.env['mrp.workorder'].browse(self.ids) workorder = self.env['mrp.workorder'].browse(self.ids)
# if "*" not in barcode: # workorder = self.env['mrp.workorder'].search(
# if self.routing_type == '装夹': # [('routing_type', '=', '装夹预调'), ('production_id', '=', self.production_id.id)])
# tray_code = self.env['sf.tray'].search([('code', '=', barcode)]) if workorder:
# self.tray_code = tray_code.code if workorder.routing_type == '装夹预调':
# self.tray_id = workorder.gettray_auto(barcode) stock_move_line = self.env['stock.move.line'].search([('lot_name', '=', barcode)])
# elif self.routing_type == '前置三元定位检测': if stock_move_line.product_id.categ_type == '夹具':
# print('我是前置三元检测') workorder.write({
# logging.info('我是前置三元检测') 'tray_serial_number': stock_move_line.lot_name,
# elif self.routing_type == 'CNC加工': 'tray_product_id': stock_move_line.product_id.id,
# if barcode == 'UP-ALL': 'tray_brand_id': stock_move_line.product_id.brand_id.id,
# print("我是一键合并下发") 'tray_type_id': stock_move_line.product_id.fixture_material_id.id,
# logging.info('我是一键合并下发') 'tray_model_id': stock_move_line.product_id.fixture_model_id.id
# self.up_merge_all() })
# else: workorder.button_start()
# print('CNC加工') else:
# # print(barcode) embryo_stock_lot = self.env['stock.lot'].search([('name', '=', barcode)])
# # a = self.env['sf.tray'].search([('code', '=', barcode)]) if embryo_stock_lot:
# # print(a) embryo_stock_move_line = self.env['stock.move.line'].search(
# # # workorder_obj = self.env['mrp.workorder'].search([('tray_code', '=', barcode)], limit=1) [('product_id', '=', embryo_stock_lot.product_id.id),
# # workorder_obj = self.env['mrp.workorder'].search([('tray_code', '=', barcode)]) ('reference', '=', workorder.production_id.name),
# # e = workorder_obj.id ('lot_id', '=', embryo_stock_lot.id),
# # print(workorder_obj) ('product_category_name', '=', '坯料')])
# # action = { if embryo_stock_move_line:
# # 'name': '工单', workpiece_delivery = self.env['sf.workpiece.delivery'].search(
# # 'type': 'ir.actions.act_window', [('workorder_id', '=', workorder.id)], limit=1, order='id asc')
# # # 'view_type': 'form', if workpiece_delivery:
# # 'view_mode': 'form', embryo_workpiece_code = workpiece_delivery.workpiece_code
# # 'res_model': 'mrp.workorder', if workpiece_delivery.workpiece_code and embryo_stock_lot.name not in \
# # 'view_id': self.env.ref('mrp.mrp_production_workorder_form_view_inherit').id, workpiece_delivery.workpiece_code:
# # # 'res_id': workorder_obj.id, embryo_workpiece_code = workpiece_delivery.workpiece_code + ',' + \
# # 'res_id': 1023, embryo_stock_lot.name
# # 'target': 'current', if not workpiece_delivery.workpiece_code:
# # # 'context': self.env.context, embryo_workpiece_code = embryo_stock_lot.name
# # # 'flags': {'initial_mode': 'edit'}, workpiece_delivery.write({'workpiece_code': embryo_workpiece_code})
# # } else:
# # return action raise UserError('工件生产线不一致,请重新确认')
#
# elif self.routing_type == '后置三元质量检测':
# print('后置三元检测')
# elif self.routing_type == '解除装夹':
# print("我是解除装夹")
# else:
# pass
#
# else:
# self.pro_code_ok = workorder.pro_code_is_ok(barcode)
class WorkpieceDelivery(models.Model): class WorkPieceDelivery(models.Model):
_name = 'sf.workpiece.delivery' _name = "sf.workpiece.delivery"
_description = '工件配送单列表' _description = '工件配送'
name = fields.Char('工件编码/任务编码') workorder_id = fields.Many2one('mrp.workorder', string='工单', readonly=True)
mrp_workorder_id = fields.Many2one('mrp.workorder', string='工件编码/任务编码', production_id = fields.Many2one('mrp.production', string='制造订单', readonly=True)
domain=[('name', 'in', ('装夹', '解除装夹'))]) 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('同运工件编码') workpiece_code = fields.Char('同运工件编码')
feeder_station_start = fields.Char('起点接驳站') feeder_station_start = fields.Char('起点接驳站')
feeder_station_destination = fields.Char('目的接驳站') feeder_station_destination = fields.Char('目的接驳站')
production_line_id = fields.Many2one('sf.production.line', string='目标生产线')
task_delivery_time = fields.Datetime('任务下发时间') task_delivery_time = fields.Datetime('任务下发时间')
task_completion_time = fields.Datetime('任务完成时间') task_completion_time = fields.Datetime('任务完成时间')
delivery_time = fields.Char('配送时长', compute='_compute_delivery_time') delivery_time = fields.Char('配送时长', compute='_compute_delivery_time')
status = fields.Selection([('待下发', '待下发'), ('待配送', '待配送'), ('已配送', '已配送')], string='状态', status = fields.Selection([('待下发', '待下发'), ('待配送', '待配送'), ('已配送', '已配送')], string='状态',
default='待下发') 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') @api.depends('task_delivery_time', 'task_completion_time')
def _compute_delivery_time(self): def _compute_delivery_time(self):
for obj in self: for obj in self:

View File

@@ -359,7 +359,6 @@ class ReStockMove(models.Model):
materiel_height = fields.Float(string='物料高度', digits=(16, 4)) materiel_height = fields.Float(string='物料高度', digits=(16, 4))
def _get_new_picking_values_Res(self, item, sorted_workorders, rescode): def _get_new_picking_values_Res(self, item, sorted_workorders, rescode):
logging.info('new_picking-rescode: %s' % rescode)
return { return {
'name': self.env['stock.picking']._get_name_Res(rescode), 'name': self.env['stock.picking']._get_name_Res(rescode),
'origin': item.name, 'origin': item.name,
@@ -373,165 +372,21 @@ class ReStockMove(models.Model):
'state': 'confirmed', 'state': 'confirmed',
} }
# 将采购到的夹具注册到Cloud def print_serial_numbers(self):
def _register_fixture(self): if not self.next_serial:
create_url = '/api/factory_fixture_material/create' raise UserError(_("请先分配序列号再进行打印"))
config = self.env['res.config.settings'].get_values() label_data = []
headers = Common.get_headers(self, config['token'], config['sf_secret_key']) for item in self.move_line_ids:
strurl = config['sf_url'] + create_url label_data.append({
for item in self: 'item_id': item.id,
val = { })
'token': config['token'], if label_data:
'name': item.product_id.name, report_template = self.env.ref('stock.label_package_template')
'brand_code': self.env['sf.machine.brand'].search([('id', '=', item.product_id.brand_id.id)]).code, res = report_template.report_action(label_data)
'fixture_material_code': self.env['sf.fixture.material'].search( res['id'] = report_template.id
[('id', '=', item.product_id.fixture_material_id.id)]).code, return res
'fixture_materials_type_code': self.env['sf.materials.model'].search( else:
[('id', '=', item.product_id.materials_type_id.id)]).materials_no, raise UserError(_("没有可打印的标签数据"))
'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("注册刀具到云端失败,请联系管理员!")
class ReStockQuant(models.Model): class ReStockQuant(models.Model):

View File

@@ -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,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_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_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 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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
25 access_sf_workpiece_delivery sf_workpiece_delivery model_sf_workpiece_delivery sf_base.group_sf_mrp_user 1 0 0 0
26 access_sf_workpiece_delivery_manager sf_workpiece_delivery model_sf_workpiece_delivery sf_base.group_sf_mrp_manager 1 1 1 0
27 access_mrp_workcenter_productivity_loss_manager access_sf_workpiece_delivery_admin mrp.workcenter.productivity.loss sf_workpiece_delivery_admin mrp.model_mrp_workcenter_productivity_loss model_sf_workpiece_delivery sf_base.group_sf_mrp_user base.group_system 1 1 1 0
28 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
29 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
30 access_mrp_workcenter_productivity_loss access_mrp_workcenter_productivity_loss_type mrp.workcenter.productivity.loss mrp.workcenter.productivity.loss.type mrp.model_mrp_workcenter_productivity_loss mrp.model_mrp_workcenter_productivity_loss_type sf_base.group_sf_mrp_user 1 0 0 0
31 access_mrp_workcenter_productivity_loss_type access_mrp_workcenter_productivity mrp.workcenter.productivity.loss.type mrp.workcenter.productivity mrp.model_mrp_workcenter_productivity_loss_type mrp.model_mrp_workcenter_productivity sf_base.group_sf_mrp_user 1 0 1 0 1 0
32 access_mrp_workcenter_productivity access_mrp_workcenter mrp.workcenter.productivity mrp.workcenter mrp.model_mrp_workcenter_productivity mrp.model_mrp_workcenter sf_base.group_sf_mrp_user 1 1 0 1 0 0

View File

@@ -18,19 +18,21 @@
<field name="product_qty" sum="Total Qty" string="数量" readonly="1" optional="show"/> <field name="product_qty" sum="Total Qty" string="数量" readonly="1" optional="show"/>
</xpath> </xpath>
<xpath expr="//field[@name='product_qty']" position="after"> <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>
<xpath expr="//field[@name='date_planned_start']" position="replace"> <xpath expr="//field[@name='date_planned_start']" position="replace">
<field name="date_planned_start" optional="show"/> <field name="date_planned_start" optional="show"/>
<field name="date_planned_finished" string="计划结束时间"/> <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>
<xpath expr="//field[@name='production_real_duration']" position="after"> <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>
<!-- <xpath expr="//field[@name='state']" position="before"> --> <!-- <xpath expr="//field[@name='state']" position="before"> -->
<!-- <field name="schedule_state" optional="show"/> --> <!-- <field name="schedule_state" optional="show"/> -->
<!-- </xpath> --> <!-- </xpath> -->
<xpath expr="//field[@name='activity_ids']" position="replace"> <xpath expr="//field[@name='activity_ids']" position="replace">
<field name="activity_ids" string="下一个活动" widget="list_activity" optional="hide"/> <field name="activity_ids" string="下一个活动" widget="list_activity" optional="hide"/>
</xpath> </xpath>
@@ -39,44 +41,54 @@
</xpath> </xpath>
<xpath expr="//field[@name='components_availability']" position="replace"> <xpath expr="//field[@name='components_availability']" position="replace">
<field name="components_availability" options='{"lazy": true}' <field name="components_availability" options='{"lazy": true}'
attrs="{'invisible': [('state', 'not in', ['confirmed', 'progress'])]}" attrs="{'invisible': [('state', 'not in', ['confirmed', 'progress'])]}"
optional="hide" optional="hide"
decoration-success="reservation_state == 'assigned' or components_availability_state == 'available'" decoration-success="reservation_state == 'assigned' or components_availability_state == 'available'"
decoration-warning="reservation_state != 'assigned' and components_availability_state in ('expected', 'available')" decoration-warning="reservation_state != 'assigned' and components_availability_state in ('expected', 'available')"
decoration-danger="reservation_state != 'assigned' and components_availability_state == 'late'"/> decoration-danger="reservation_state != 'assigned' and components_availability_state == 'late'"/>
</xpath> </xpath>
<!-- <xpath expr="//field[@name='state']" position="after"> --> <!-- <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="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'])]}"/> --> <!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
<!-- </xpath> --> <!-- </xpath> -->
</field> </field>
</record> </record>
<!-- 增加权限相关的按钮 --> <!-- 增加权限相关的按钮 -->
<!-- 制造订单的操作按钮只让制造用户可见 --> <!-- 制造订单的操作按钮只让制造用户可见 -->
<record id="custom_mrp_production_form_view" model="ir.ui.view"> <record id="custom_mrp_production_form_view" model="ir.ui.view">
<field name="name">custom.mrp.production.form</field> <field name="name">custom.mrp.production.form</field>
<field name="model">mrp.production</field> <field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/> <field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="attributes"> <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>
<xpath expr="//field[@name='user_id']" position="after"> <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="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>
<xpath expr="//header//button[@name='action_cancel']" position="replace"> <xpath expr="//header//button[@name='action_cancel']" position="replace">
<button name="action_cancel" type="object" string="取消" data-hotkey="z" <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>
<xpath expr="(//header//button[@name='button_mark_done'])[1]" position="replace"> <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" <button name="button_mark_done"
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"/> 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>
<xpath expr="(//header//button[@name='button_mark_done'])[2]" position="replace"> <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>
<xpath expr="(//header//button[@name='button_mark_done'])[3]" position="replace"> <xpath expr="(//header//button[@name='button_mark_done'])[3]" position="replace">
<button name="button_mark_done" attrs="{'invisible': [ <button name="button_mark_done" attrs="{'invisible': [
@@ -86,7 +98,8 @@
'|', '|',
('state', 'not in', ('confirmed', 'progress')), ('state', 'not in', ('confirmed', 'progress')),
('qty_producing', '!=', 0), ('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>
<xpath expr="(//header//button[@name='button_mark_done'])[4]" position="replace"> <xpath expr="(//header//button[@name='button_mark_done'])[4]" position="replace">
<button name="button_mark_done" attrs="{'invisible': [ <button name="button_mark_done" attrs="{'invisible': [
@@ -96,61 +109,135 @@
'|', '|',
('state', 'not in', ('confirmed', 'progress')), ('state', 'not in', ('confirmed', 'progress')),
('qty_producing', '!=', 0), ('qty_producing', '!=', 0),
('state', '!=', 'to_close')]}" string="标记完成" type="object" class="oe_highlight" data-hotkey="g" ('state', '!=', 'to_close')]}" string="标记完成" type="object" class="oe_highlight"
confirm="There are no components to consume. Are you still sure you want to continue?" groups="sf_base.group_sf_mrp_user"/> 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>
<xpath expr="//header//button[@name='button_unplan']" position="replace"> <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>
<xpath expr="//header//button[@name='button_scrap']" position="replace"> <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>
<xpath expr="//header//button[@name='action_confirm']" position="replace"> <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>
<xpath expr="//header//button[@name='button_plan']" position="replace"> <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>
<xpath expr="//header//button[@name='action_assign']" position="replace"> <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>
<xpath expr="//header//button[@name='do_unreserve']" position="replace"> <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>
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace"> <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>
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace"> <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>
<xpath expr="//header//button[@name='action_serial_mass_produce_wizard']" position="replace"> <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>
<xpath expr="//header//button[@name='action_cancel']" position="replace"> <xpath expr="//header//button[@name='action_cancel']" position="replace">
<button name="action_cancel" type="object" string="取消" data-hotkey="z" <button name="action_cancel" type="object" string="Cancel" data-hotkey="z"
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', False)]}" 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"/> 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>
<xpath expr="//header//button[@name='button_unbuild']" position="replace"> <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>
<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> </field>
</record> </record>
<!-- 工单的操作按钮只让制造用户可见 --> <!-- 工单的操作按钮只让制造用户可见 -->
<record id="sf_mrp_production_workorder_tree_editable_view" model="ir.ui.view"> <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="name">sf.mrp.production.workorder.tree.editable</field>
<field name="model">mrp.workorder</field> <field name="model">mrp.workorder</field>
@@ -158,76 +245,111 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//tree//button[@name='button_start']" position="replace"> <xpath expr="//tree//button[@name='button_start']" position="replace">
<button name="button_start" type="object" string="开始" class="btn-success" <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>
<xpath expr="//tree//button[@name='button_pending']" position="replace"> <xpath expr="//tree//button[@name='button_pending']" position="replace">
<button name="button_pending" type="object" string="暂停" class="btn-warning" <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>
<xpath expr="//tree//button[@name='button_finish']" position="replace"> <xpath expr="//tree//button[@name='button_finish']" position="replace">
<button name="button_finish" type="object" string="完成" class="btn-success" <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>
<xpath expr="//tree//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="replace"> <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" <button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="阻塞"
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}" groups="sf_base.group_sf_mrp_user"/> 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>
<xpath expr="//tree//button[@name='button_unblock']" position="replace"> <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" <button name="button_unblock" type="object" string="取消阻塞"
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}" groups="sf_base.group_sf_mrp_user"/> 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>
<xpath expr="//tree//button[@name='action_open_wizard']" position="replace"> <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" <button name="action_open_wizard" type="object" icon="fa-external-link" class="oe_edit_only"
title="未完成工单" 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> </xpath>
</field> </field>
</record> </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 id="custom_mrp_production_form_view" model="ir.ui.view"> -->
</record> <!-- <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"> -->
<!-- <record id="custom_mrp_production_form_view" model="ir.ui.view"> --> <!-- <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,已排程,progress,done"/> -->
<!-- <field name="name">custom.mrp.production.form</field> --> <!-- </xpath> -->
<!-- <field name="model">mrp.production</field> --> <!-- <xpath expr="//header" position="inside"> -->
<!-- <field name="inherit_id" ref="mrp.mrp_production_form_view"/> --> <!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
<!-- <field name="arch" type="xml"> --> <!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
<!-- <xpath expr="//header//field[@name='state']" position="replace"> --> <!-- </xpath> -->
<!-- <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,已排程,progress,done"/> --> <!-- <xpath expr="//sheet//group//group//field[@name='product_id']" position="after"> -->
<!-- </xpath> --> <!-- <field name="production_line_id"/> -->
<!-- <xpath expr="//header" position="inside"> --> <!-- <field name="date_planned_finished" string="计划结束时间"/> -->
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> --> <!-- </xpath> -->
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> --> <!-- <xpath expr="//sheet//group//group//field[@name='date_planned_start']" position="after"> -->
<!-- </xpath> --> <!-- <field name="date_planned_finished"/> -->
<!-- <xpath expr="//sheet//group//group//field[@name='product_id']" position="after"> --> <!-- </xpath> -->
<!-- <field name="production_line_id"/> --> <!-- </field> -->
<!-- <field name="date_planned_finished" string="计划结束时间"/> --> <!-- </record> -->
<!-- </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"> <record id="custom_view_mrp_production_filter" model="ir.ui.view">
<field name="name">custom.mrp.production.select</field> <field name="name">custom.mrp.production.select</field>
@@ -243,24 +365,24 @@
</field> </field>
</record> </record>
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> --> <!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已完成" name="filter_done" domain="[('state', '=', 'done')]"/> --> <!-- <filter string="已完成" name="filter_done" domain="[('state', '=', 'done')]"/> -->
<!-- </xpath> --> <!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> --> <!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已取消" name="filter_cancel" domain="[('state', '=', 'cancel')]"/> --> <!-- <filter string="已取消" name="filter_cancel" domain="[('state', '=', 'cancel')]"/> -->
<!-- </xpath> --> <!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> --> <!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="进行中" name="filter_progress" domain="[('state', '=', 'progress')]"/> --> <!-- <filter string="进行中" name="filter_progress" domain="[('state', '=', 'progress')]"/> -->
<!-- </xpath> --> <!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> --> <!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已确认" name="filter_confirmed" domain="[('state', '=', 'confirmed')]"/> --> <!-- <filter string="已确认" name="filter_confirmed" domain="[('state', '=', 'confirmed')]"/> -->
<!-- </xpath> --> <!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> --> <!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="草稿" name="filter_draft" domain="[('state', '=', 'draft')]"/> --> <!-- <filter string="草稿" name="filter_draft" domain="[('state', '=', 'draft')]"/> -->
<!-- </xpath> --> <!-- </xpath> -->
<!-- 产品模板修改>>>增加“规格”字段specification_id --> <!-- 产品模板修改>>>增加“规格”字段specification_id -->
<record id="custom_product_template_kanban_view" model="ir.ui.view"> <record id="custom_product_template_kanban_view" model="ir.ui.view">
<field name="name">custom.Product.template.product.kanban</field> <field name="name">custom.Product.template.product.kanban</field>
<field name="model">product.template</field> <field name="model">product.template</field>
@@ -268,44 +390,52 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//kanban" position="replace"> <xpath expr="//kanban" position="replace">
<kanban sample="1" class="o_kanban_product_template"> <kanban sample="1" class="o_kanban_product_template">
<field name="id"/> <field name="id"/>
<field name="product_variant_count"/> <field name="product_variant_count"/>
<field name="currency_id"/> <field name="currency_id"/>
<field name="activity_state"/> <field name="activity_state"/>
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/> <progressbar field="activity_state"
<templates> colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<t t-name="kanban-box"> <templates>
<div class="oe_kanban_card oe_kanban_global_click"> <t t-name="kanban-box">
<div class="o_kanban_image me-1"> <div class="oe_kanban_card oe_kanban_global_click">
<img t-att-src="kanban_image('product.template', 'image_128', record.id.raw_value)" alt="Product" class="o_image_64_contain"/> <div class="o_kanban_image me-1">
</div> <img t-att-src="kanban_image('product.template', 'image_128', record.id.raw_value)"
<div class="oe_kanban_details"> alt="Product" class="o_image_64_contain"/>
<div class="o_kanban_record_top mb-0"> </div>
<div class="o_kanban_record_headings"> <div class="oe_kanban_details">
<strong class="o_kanban_record_title"> <div class="o_kanban_record_top mb-0">
<field name="name"/> <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 &gt; 1"
groups="product.group_product_variant">
<strong>
<t t-esc="record.product_variant_count.value"/>
Variants
</strong> </strong>
</div> </div>
<field name="priority" widget="priority"/> <div name="product_lst_price" class="mt-1">
</div> 价格:
<field name="list_price" widget="monetary"
<div name="product_specification_id" class="mt-1"> options="{'currency_field': 'currency_id', 'field_digits': True}"></field>
规格: <field name="specification_id"></field> </div>
</div>
<t t-if="record.default_code.value">[<field name="default_code"/>]</t>
<div t-if="record.product_variant_count.value &gt; 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> </div>
</div> </div>
</div> </t>
</t> </templates>
</templates> </kanban>
</kanban>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@@ -117,12 +117,15 @@
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/> 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="停工" <button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工"
context="{'default_workcenter_id': workcenter_id}" class="btn-danger" 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加工程序')]}"/> attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'),('user_permissions','=',False),('name','=','获取CNC加工程序')]}"/>
<button name="button_unblock" type="object" string="Unblock" <button name="button_unblock" type="object" string="Unblock"
context="{'default_workcenter_id': workcenter_id}" class="btn-danger" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
groups="sf_base.group_sf_mrp_user" groups="sf_base.group_sf_mrp_user"
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('name','=','获取CNC加工程序')]}"/> 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>
<xpath expr="//page[1]" position="before"> <xpath expr="//page[1]" position="before">
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'> <page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
@@ -234,11 +237,12 @@
<field name="chuck_model_id"/> <field name="chuck_model_id"/>
</group> </group>
<group string="托盘"> <group string="托盘">
<field name="tray_serial_number"/> <field name="_barcode_scanned" widget="barcode_handler"/>
<field name="tray_name"/> <field name="tray_serial_number" readonly="1" string="序列号"/>
<field name="tray_brand_id"/> <field name="tray_product_id" readonly="1" string="名称"/>
<field name="tray_type_id"/> <field name="tray_brand_id" readonly="1" string="品牌"/>
<field name="tray_model_id"/> <field name="tray_type_id" readonly="1" string="类型"/>
<field name="tray_model_id" readonly="1" string="型号"/>
</group> </group>
</group> </group>
<group string="预调程序信息"> <group string="预调程序信息">
@@ -395,10 +399,23 @@
</div> </div>
<group> <group>
<field name="material_center_point"/> <field name="material_center_point" readonly="1"/>
<field name='X_deviation_angle'/> <field name='X_deviation_angle' readonly="1"/>
</group> </group>
</page> </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> </xpath>
@@ -496,11 +513,11 @@
<!--=========================================工件配送单列表======================================--> <!--=========================================工件配送单列表======================================-->
<record id="sf_workpiece_delivery_tree" model="ir.ui.view"> <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="model">sf.workpiece.delivery</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="工件配送单列表" editable="bottom"> <tree string="工件配送" editable="bottom">
<field name="mrp_workorder_id"/> <field name="production_id"/>
<field name="workpiece_code"/> <field name="workpiece_code"/>
<field name="feeder_station_start"/> <field name="feeder_station_start"/>
<field name="production_line_id"/> <field name="production_line_id"/>
@@ -514,11 +531,11 @@
</record> </record>
<record id="sf_workpiece_delivery_search" model="ir.ui.view"> <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="model">sf.workpiece.delivery</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="工件配送单列表"> <search string="工件配送">
<field name="mrp_workorder_id"/> <field name="production_id"/>
<field name="workpiece_code"/> <field name="workpiece_code"/>
<field name="feeder_station_start"/> <field name="feeder_station_start"/>
<field name="production_line_id"/> <field name="production_line_id"/>
@@ -536,7 +553,7 @@
</record> </record>
<record id="sf_workpiece_delivery_act" model="ir.actions.act_window"> <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="res_model">sf.workpiece.delivery</field>
<field name="view_mode">tree,search</field> <field name="view_mode">tree,search</field>
</record> </record>

View File

@@ -1,6 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<data> <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"> <record model="ir.ui.view" id="view_picking_form_inherit_sf">
<field name="name">stock.picking.form.inherit.sf</field> <field name="name">stock.picking.form.inherit.sf</field>
<field name="model">stock.picking</field> <field name="model">stock.picking</field>

View File

@@ -67,6 +67,12 @@ class sf_production_plan(models.Model):
sequence = fields.Integer(string='序号', copy=False, readonly=True, index=True) sequence = fields.Integer(string='序号', copy=False, readonly=True, index=True)
current_operation_name = fields.Char(string='当前工序名称', size=64, default='生产计划') 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') @api.onchange('state')
def _onchange_state(self): def _onchange_state(self):
if self.state == 'finished': if self.state == 'finished':
@@ -324,33 +330,6 @@ class sf_production_plan(models.Model):
raise UserError(e) 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): class machine_work_schedule(models.Model):
_name = 'sf.machine.schedule' _name = 'sf.machine.schedule'

View File

@@ -10,10 +10,11 @@
<xpath expr="//form//header//button[@name='action_validate']" position="after"> <xpath expr="//form//header//button[@name='action_validate']" position="after">
<field name="active" invisible="1"/> <field name="active" invisible="1"/>
<field name="check_status" 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="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="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_check" string="审核" type="object" class="oe_highlight"
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> --> 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> </xpath>
</field> </field>
</record> </record>
@@ -27,32 +28,33 @@
<xpath expr="//form//header//button[@name='action_validate']" position="after"> <xpath expr="//form//header//button[@name='action_validate']" position="after">
<field name="active" invisible="1"/> <field name="active" invisible="1"/>
<field name="check_status" 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="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="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_check" string="审核" type="object" class="oe_highlight"
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> --> 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> </xpath>
</field> </field>
</record> </record>
<!-- 增加权限相关的按钮 --> <!-- 增加权限相关的按钮 -->
<!-- <record id="custom_product_template_form_view" model="ir.ui.view"> --> <!-- <record id="custom_product_template_form_view" model="ir.ui.view"> -->
<!-- <field name="name">custom.product.template.form</field> --> <!-- <field name="name">custom.product.template.form</field> -->
<!-- <field name="model">product.template</field> --> <!-- <field name="model">product.template</field> -->
<!-- <field name="inherit_id" ref="product.product_template_form_view"/> --> <!-- <field name="inherit_id" ref="product.product_template_form_view"/> -->
<!-- <field name="arch" type="xml"> --> <!-- <field name="arch" type="xml"> -->
<!-- <xpath expr="//form//header" position="inside"> --> <!-- <xpath expr="//form//header" position="inside"> -->
<!-- <field name="active" invisible="1"/> --> <!-- <field name="active" invisible="1"/> -->
<!-- <field name="check_status" 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="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="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_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="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
<!-- </xpath> --> <!-- </xpath> -->
<!-- </field> --> <!-- </field> -->
<!-- </record> --> <!-- </record> -->
<!-- 增加权限相关的按钮 --> <!-- 增加权限相关的按钮 -->
<record id="custom_mrp_bom_form_view" model="ir.ui.view"> <record id="custom_mrp_bom_form_view" model="ir.ui.view">
<field name="name">custom.mrp.bom.form</field> <field name="name">custom.mrp.bom.form</field>
<field name="model">mrp.bom</field> <field name="model">mrp.bom</field>
@@ -62,10 +64,12 @@
<header> <header>
<field name="active" invisible="1"/> <field name="active" invisible="1"/>
<field name="check_status" 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="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="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_check" string="审核" type="object" class="oe_highlight"
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> --> 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> </header>
</xpath> </xpath>
</field> </field>
@@ -81,10 +85,12 @@
<header> <header>
<field name="active" invisible="1"/> <field name="active" invisible="1"/>
<field name="check_status" 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="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="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_check" string="审核" type="object" class="oe_highlight"
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> --> 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> </header>
</xpath> </xpath>
</field> </field>
@@ -100,10 +106,12 @@
<header> <header>
<field name="active" invisible="1"/> <field name="active" invisible="1"/>
<field name="check_status" 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="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="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_check" string="审核" type="object" class="oe_highlight"
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> --> 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> </header>
</xpath> </xpath>
</field> </field>
@@ -119,10 +127,12 @@
<header> <header>
<field name="active" invisible="1"/> <field name="active" invisible="1"/>
<field name="check_status" 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="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="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_check" string="审核" type="object" class="oe_highlight"
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> --> 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> </header>
</xpath> </xpath>
</field> </field>
@@ -138,10 +148,12 @@
<header> <header>
<field name="active" invisible="1"/> <field name="active" invisible="1"/>
<field name="check_status" 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="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="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_check" string="审核" type="object" class="oe_highlight"
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> --> 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> </header>
</xpath> </xpath>
</field> </field>
@@ -157,10 +169,12 @@
<header> <header>
<field name="active" invisible="1"/> <field name="active" invisible="1"/>
<field name="check_status" 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="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="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_check" string="审核" type="object" class="oe_highlight"
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> --> 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> </header>
</xpath> </xpath>
</field> </field>

View File

@@ -5,13 +5,16 @@
<field name="name">sf.production.plan.tree</field> <field name="name">sf.production.plan.tree</field>
<field name="model">sf.production.plan</field> <field name="model">sf.production.plan</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<!-- <tree string="订单计划" editable="bottom"> --> <!-- <tree string="订单计划" editable="bottom"> -->
<tree string="订单计划"> <tree string="订单计划">
<header> <header>
<!-- <button name="do_production_schedule" type="object" string="批量排程"/> --> <!-- <button name="do_production_schedule" type="object" string="批量排程"/> -->
<button string="批量排程" name="%(sf_plan.action_plan_some)d" type="action" class="btn-primary"/> <button string="批量排程" name="%(sf_plan.action_plan_some)d" type="action"
class="btn-primary"/>
</header> </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="name"/>
<field name="origin"/> <field name="origin"/>
<field name="order_deadline"/> <field name="order_deadline"/>
@@ -20,8 +23,12 @@
<field name="date_planned_start"/> <field name="date_planned_start"/>
<field name="date_planned_finished"/> <field name="date_planned_finished"/>
<field name="schedule_setting"/> <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="do_production_schedule" class="btn schedule_done" string="生产排程" type="object"
<button name="cancel_production_schedule" class="btn schedule_cancel" string="取消排程" type="object" attrs="{'invisible': [('state', 'not in', ['done'])]}" groups="sf_base.group_plan_dispatch"/> 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> </tree>
</field> </field>
</record> </record>
@@ -32,14 +39,17 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="订单计划"> <form string="订单计划">
<header> <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" 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="do_production_schedule" type="object" class="oe_highlight"
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight" groups="sf_base.group_plan_dispatch" attrs="{'invisible': [('state', '=', 'draft')]}"/> options='{"calendar_view": true, "date_begin": "2020-01-01", "date_end": "2020-12-31"}'
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> --> groups="sf_base.group_plan_dispatch" attrs="{'invisible': [('state', '=', 'done')]}"/>
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> --> <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="test_sale_order" type="object" class="oe_highlight"/> -->
<!-- <button string="测试流程" name="liucheng_cs" 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"/> <field name="state" widget="statusbar" statusbar_visible="draft,done,processing,finished"/>
</header> </header>
<sheet> <sheet>
@@ -68,54 +78,54 @@
<field name="shift" widget="time"/> <field name="shift" widget="time"/>
<!-- Chatter --> <!-- Chatter -->
<!-- <div class="oe_chatter"> --> <!-- <div class="oe_chatter"> -->
<!-- <field name="message_follower_ids" widget="mail_followers"/> --> <!-- <field name="message_follower_ids" widget="mail_followers"/> -->
<!-- <field name="message_ids" widget="mail_thread"/> --> <!-- <field name="message_ids" widget="mail_thread"/> -->
<!-- <field name="activity_ids"/> --> <!-- <field name="activity_ids"/> -->
<!-- </div> --> <!-- </div> -->
<div class="oe_chatter"> <div class="oe_chatter">
<field name="message_follower_ids"/> <field name="message_follower_ids"/>
<field name="message_ids"/> <field name="message_ids"/>
</div> </div>
</group> </group>
<!-- <group string="规格信息" col="1"> --> <!-- <group string="规格信息" col="1"> -->
<!-- <group col="3"> --> <!-- <group col="3"> -->
<!-- <group> --> <!-- <group> -->
<!-- <field name="length"/> --> <!-- <field name="length"/> -->
<!-- </group> --> <!-- </group> -->
<!-- <group> --> <!-- <group> -->
<!-- <field name="width"/> --> <!-- <field name="width"/> -->
<!-- </group> --> <!-- </group> -->
<!-- <group> --> <!-- <group> -->
<!-- <field name="thickness"/> --> <!-- <field name="thickness"/> -->
<!-- </group> --> <!-- </group> -->
<!-- </group> --> <!-- </group> -->
<!-- <field name="length"/> --> <!-- <field name="length"/> -->
<!-- <field name="width"/> --> <!-- <field name="width"/> -->
<!-- <field name="thickness"/> --> <!-- <field name="thickness"/> -->
<!-- <group> --> <!-- <group> -->
<!-- <field name="diameter"/> --> <!-- <field name="diameter"/> -->
<!-- <field name="material"/> --> <!-- <field name="material"/> -->
<!-- </group> --> <!-- </group> -->
<!-- </group> --> <!-- </group> -->
<!-- <group string="绑定订单"> --> <!-- <group string="绑定订单"> -->
<!-- <field name="customer_name"/> --> <!-- <field name="customer_name"/> -->
<!-- <field name="order_no"/> --> <!-- <field name="order_no"/> -->
<!-- <field name="line_no"/> --> <!-- <field name="line_no"/> -->
<!-- <field name="delivery_length"/> --> <!-- <field name="delivery_length"/> -->
<!-- <field name="delivery_width"/> --> <!-- <field name="delivery_width"/> -->
<!-- <field name="delivery_thickness"/> --> <!-- <field name="delivery_thickness"/> -->
<!-- <field name="delivery_diameter"/> --> <!-- <field name="delivery_diameter"/> -->
<!-- <field name="delivery_quantity"/> --> <!-- <field name="delivery_quantity"/> -->
<!-- <field name="delivery_date"/> --> <!-- <field name="delivery_date"/> -->
<!-- </group> --> <!-- </group> -->
</group> </group>
</sheet> </sheet>
</form> </form>
</field> </field>
</record> </record>
<!-- 搜索视图 --> <!-- 搜索视图 -->
<record id="sf_production_plan_search" model="ir.ui.view"> <record id="sf_production_plan_search" model="ir.ui.view">
<field name="name">sf.production.plan.search</field> <field name="name">sf.production.plan.search</field>
<field name="model">sf.production.plan</field> <field name="model">sf.production.plan</field>
@@ -151,7 +161,7 @@
default_scale="day" default_scale="day"
scales="day,week,month,year" scales="day,week,month,year"
precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day', 'year': 'month:quarter'}"> precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day', 'year': 'month:quarter'}">
<field name="shift"/> <field name="shift"/>
<field name="name"/> <field name="name"/>
<field name="product_qty"/> <field name="product_qty"/>
<field name="date_planned_start"/> <field name="date_planned_start"/>
@@ -191,65 +201,6 @@
</field> </field>
</record> </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"> <record id="sf_machine_schedule_tree" model="ir.ui.view">
<field name="name">sf.machine.schedule.tree</field> <field name="name">sf.machine.schedule.tree</field>
<field name="model">sf.machine.schedule</field> <field name="model">sf.machine.schedule</field>
@@ -268,7 +219,7 @@
<field name="view_mode">gantt,tree,form</field> <field name="view_mode">gantt,tree,form</field>
</record> </record>
<!-- 这个也是制造订单生产计划只是把tree视图放在了默认位置 --> <!-- 这个也是制造订单生产计划只是把tree视图放在了默认位置 -->
<record id="sf_production_plan_action1" model="ir.actions.act_window"> <record id="sf_production_plan_action1" model="ir.actions.act_window">
<field name="name">制造订单生产计划</field> <field name="name">制造订单生产计划</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
@@ -284,11 +235,11 @@
groups="sf_base.group_plan_dispatch" groups="sf_base.group_plan_dispatch"
/> />
<!-- <record model="ir.ui.menu" id="mrp_custom_menu" inherit_id="mrp.menu_mrp_manufacturing"> --> <!-- <record model="ir.ui.menu" id="mrp_custom_menu" inherit_id="mrp.menu_mrp_manufacturing"> -->
<!-- <field name="name">Custom Manufacturing Orders</field> --> <!-- <field name="name">Custom Manufacturing Orders</field> -->
<!-- <field name="action" ref="mrp.mrp_manufacturing_action"/> --> <!-- <field name="action" ref="mrp.mrp_manufacturing_action"/> -->
<!-- --><!-- 扩展现有的动作 --><!-- --> <!-- --><!-- 扩展现有的动作 --><!-- -->
<!-- </record> --> <!-- </record> -->
<record model="ir.actions.act_window" id="mrp_custom_action"> <record model="ir.actions.act_window" id="mrp_custom_action">
<!-- 自定义额外的动作 --> <!-- 自定义额外的动作 -->
<field name="name">制造订单</field> <field name="name">制造订单</field>
@@ -305,17 +256,17 @@
</record> </record>
<record model="ir.actions.act_window" id="action_machine_work_schedule"> <record model="ir.actions.act_window" id="action_machine_work_schedule">
<!-- 自定义额外的动作 --> <!-- 自定义额外的动作 -->
<field name="name">机台作业计划</field> <field name="name">机台作业计划</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">sf.machine.schedule</field> <field name="res_model">sf.machine.schedule</field>
<field name="view_mode">tree</field> <field name="view_mode">tree</field>
<field name="help" type="html"> <field name="help" type="html">
<p class="o_view_nocontent_smiling_face"> <p class="o_view_nocontent_smiling_face">
暂无机台作业计划 暂无机台作业计划
</p> </p>
<p> <p>
跟进请求的处理,并且和合作者沟通。 跟进请求的处理,并且和合作者沟通。
</p> </p>
</field> </field>
</record> </record>
@@ -330,18 +281,18 @@
<menuitem <menuitem
id="sf_workpiece_delivery_menu" id="sf_workpiece_delivery_menu"
name="工件配送单列表" name="工件配送"
sequence="10" sequence="10"
action="sf_manufacturing.sf_workpiece_delivery_act" action="sf_manufacturing.sf_workpiece_delivery_act"
parent="mrp.menu_mrp_manufacturing" parent="mrp.menu_mrp_manufacturing"
/> />
<!-- <menuitem --> <!-- <menuitem -->
<!-- id="sale_custom_menu" --> <!-- id="sale_custom_menu" -->
<!-- name="报价单" --> <!-- name="报价单" -->
<!-- sequence="50" --> <!-- sequence="50" -->
<!-- action="sale_custom_action" --> <!-- action="sale_custom_action" -->
<!-- parent="sf_production_plan_menu" --> <!-- parent="sf_production_plan_menu" -->
<!-- /> --> <!-- /> -->
<menuitem <menuitem
id="schedule_custom_menu" id="schedule_custom_menu"
name="排程单" name="排程单"
@@ -349,22 +300,6 @@
action="sf_production_plan_action1" action="sf_production_plan_action1"
parent="sf_production_plan_menu" 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> </data>
</odoo> </odoo>

View File

@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import datetime import datetime
import logging import logging
from odoo import api, fields, models from odoo import api, fields, models, _
from odoo.osv import expression from odoo.osv import expression
from odoo.exceptions import UserError
class SfLocation(models.Model): class SfLocation(models.Model):

View File

@@ -15,10 +15,10 @@
('location_id', '=', location_dest_id_value), ('location_id', '=', location_dest_id_value),
('location_status', '=', '空闲') ('location_status', '=', '空闲')
]"/> ]"/>
<!-- <field name="location_dest_id_product_type"/> --> <!-- <field name="location_dest_id_product_type"/> -->
<!-- <field name="location_dest_id"/> --> <!-- <field name="location_dest_id"/> -->
<field name="location_dest_id_value" invisible="1"/> <field name="location_dest_id_value" invisible="1"/>
<!-- <button name="button_test" string="测试" type="object" class="oe_highlight"/> --> <!-- <button name="button_test" string="测试" type="object" class="oe_highlight"/> -->
</xpath> </xpath>
</field> </field>
</record> </record>
@@ -55,26 +55,37 @@
</field> </field>
</record> </record>
<!-- 原生的按钮对base.user可见这里修改为对库存用户可见 --> <!-- 原生的按钮对base.user可见这里修改为对库存用户可见 -->
<record id="sf_view_picking_form" model="ir.ui.view"> <record id="sf_view_picking_form" model="ir.ui.view">
<field name="name">sf.view.picking.form</field> <field name="name">sf.view.picking.form</field>
<field name="model">stock.picking</field> <field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/> <field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//form//header//button[@name='action_cancel']" position="replace"> <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>
<xpath expr="//form//header//button[@name='do_unreserve']" position="replace"> <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), '&amp;', ('state', '!=', 'assigned'), ('move_type', '!=', 'one'), '&amp;', ('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), '&amp;', ('state', '!=', 'assigned'), ('move_type', '!=', 'one'), '&amp;', ('state', 'not in', ('assigned', 'confirmed')), ('move_type', '=', 'one')]}"
data-hotkey="w"/>
</xpath> </xpath>
<xpath expr="//form//header//button[@name='button_scrap']" position="replace"> <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': ['|', '&amp;', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&amp;', ('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': ['|', '&amp;', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&amp;', ('picking_type_code', '=', 'outgoing'), ('state', '=', 'done')]}"
data-hotkey="y"/>
</xpath> </xpath>
<xpath expr="//form//header//button[@name='action_assign']" position="replace"> <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>
<xpath expr="//form//header//button[@name='%(stock.act_stock_return_picking)d']" position="replace"> <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> </xpath>
</field> </field>
@@ -86,7 +97,9 @@
<field name="inherit_id" ref="stock.stock_scrap_form_view"/> <field name="inherit_id" ref="stock.stock_scrap_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//header//button[@name='action_validate']" position="replace"> <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> </xpath>
</field> </field>
</record> </record>
@@ -97,10 +110,12 @@
<field name="inherit_id" ref="stock.vpicktree"/> <field name="inherit_id" ref="stock.vpicktree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//header//button[@name='do_unreserve']" position="replace"> <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>
<xpath expr="//header//button[@name='action_assign']" position="replace"> <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> </xpath>
</field> </field>
</record> </record>

View File

@@ -13,20 +13,23 @@ class StockMoveLine(models.Model):
picking_location_dest_id = fields.Many2one(related='picking_id.location_dest_id') 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_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_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") 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') @api.depends('product_id', 'product_id.stock_quant_ids')
def _compute_product_stock_quant_ids(self): def _compute_product_stock_quant_ids(self):
for line in 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): def _compute_dummy_id(self):
self.dummy_id = '' self.dummy_id = ''
def _compute_product_packaging_uom_qty(self): def _compute_product_packaging_uom_qty(self):
for sml in 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') @api.depends('qty_done')
def _compute_is_completed(self): def _compute_is_completed(self):

View File

@@ -1,201 +1,236 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <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"> <record id="stock_move_line_product_selector" model="ir.ui.view">
<field name="name">stock.product.selector</field> <field name="name">stock.product.selector</field>
<field name="model">stock.move.line</field> <field name="model">stock.move.line</field>
<field name="priority">1000</field> <field name="priority">1000</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Select a Product" class="o_barcode_line_form flex-column"> <form string="Select a Product" class="o_barcode_line_form flex-column">
<div class="row mt-4 mb-4"> <div class="row mt-4 mb-4">
<field name="company_id" force_save="1" invisible="1"/> <field name="company_id" force_save="1" invisible="1"/>
<field name="reserved_uom_qty" invisible="1" /> <field name="reserved_uom_qty" invisible="1"/>
<field name="move_id" invisible="1" /> <field name="move_id" invisible="1"/>
<field name="state" invisible="1" /> <field name="state" invisible="1"/>
<field name="tracking" invisible="1" /> <field name="tracking" invisible="1"/>
<field name="product_uom_category_id" invisible="1" /> <field name="product_uom_category_id" invisible="1"/>
<field name="picking_code" 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="picking_id" invisible="1"/>
<field name="location_id" invisible="1"/> <field name="picking_type_use_create_lots" invisible="1"/>
<field name="location_dest_id" invisible="1"/> <field name="picking_type_use_existing_lots" invisible="1"/>
<div class="col-12 d-flex align-items-baseline"> <field name="picking_location_id" invisible="1"/>
<i class="fa fa-fw fa-lg fa-tags me-3" title="Product"/> <field name="picking_location_dest_id" invisible="1"/>
<field name="product_id" placeholder="Product" <div class="row" groups="stock.group_production_lot">
context="{'default_detailed_type': 'product'}" <div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}" <i class="fa fa-fw fa-lg fa-barcode me-3" title="Serial/Lot Number"
domain="[('type', 'in', ['product', 'consu']), '|', ('company_id', '=', False), ('company_id', '=', company_id)]" attrs="{'invisible': [('tracking', 'not in', ['serial', 'lot'])]}"/>
required="1" nolabel="1"/> <field name="lot_name" placeholder="Serial/Lot Number"
</div> attrs="{'invisible': ['|', '|', ('tracking', '=', 'none'), ('picking_type_use_create_lots', '=', False), ('picking_type_use_existing_lots', '=', True)]}"
</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="lot_id" placeholder="Serial/Lot Number" options="{'no_open': True}" <field name="lot_id" placeholder="Serial/Lot Number" options="{'no_open': True}"
context="{'default_product_id': product_id, 'default_company_id': company_id}" context="{'default_product_id': product_id, 'default_company_id': company_id}"
attrs="{'invisible': ['|', ('tracking', '=', 'none'), ('picking_type_use_existing_lots', '=', False)]}" attrs="{'invisible': ['|', ('tracking', '=', 'none'), ('picking_type_use_existing_lots', '=', False)]}"
/> />
</div>
</div> </div>
</div>
<div class="row row-long"> <div class="row row-long">
<div class="col-12 my-2 d-flex"> <div class="col-12 my-2 d-flex">
<i class="fa fa-fw fa-lg fa-cubes me-3" title="Locations"/> <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'}"/> <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> <div class="fixed-bottom">
<div class="fixed-bottom"> <div class="o_barcode_control d-flex">
<div class="o_barcode_control d-flex"> <button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/> <button string="Confirm" class="btn btn-primary o_save" special="save"/>
<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>
<div class="o_barcode_control d-flex" attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}"> </form>
<button string="Delete" class="btn btn-danger text-uppercase o_delete" </field>
name="unlink" type="object"> </record>
<i class="fa fa-trash-o"/> Delete
</button>
</div>
</div>
</form>
</field>
</record>
<record id="stock_quant_barcode_kanban" model="ir.ui.view"> <record id="stock_quant_barcode_kanban" model="ir.ui.view">
<field name="name">stock.barcode.quant.kanban</field> <field name="name">stock.barcode.quant.kanban</field>
<field name="model">stock.quant</field> <field name="model">stock.quant</field>
<field name="priority">1000</field> <field name="priority">1000</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<kanban draggable="0"> <kanban draggable="0">
<field name="product_id"/> <field name="product_id"/>
<field name="quantity"/> <field name="quantity"/>
<templates> <templates>
<t t-name="kanban-box"> <t t-name="kanban-box">
<div> <div>
<strong><field name="product_id"/></strong> <strong>
<div class="row"> <field name="product_id"/>
<div class="col-6"> </strong>
<field name="lot_id" groups="stock.group_production_lot"/> <div class="row">
<field name="quantity" string="Quantity Done"/> <div class="col-6">
<field name="product_uom_id" string="Unit of Measure" groups="uom.group_uom"/> <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> </div>
</div> </t>
</t> </templates>
</templates> </kanban>
</kanban> </field>
</field> </record>
</record>
<record id="stock_quant_barcode_kanban_2" model="ir.ui.view"> <record id="stock_quant_barcode_kanban_2" model="ir.ui.view">
<field name="name">stock.quant.kanban.barcode</field> <field name="name">stock.quant.kanban.barcode</field>
<field name="model">stock.quant</field> <field name="model">stock.quant</field>
<field name="priority">1000</field> <field name="priority">1000</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<kanban class="o_kanban_mobile"> <kanban class="o_kanban_mobile">
<templates> <templates>
<t t-name="kanban-box"> <t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click"> <div t-attf-class="oe_kanban_global_click">
<div class="mb4"> <div class="mb4">
<strong><field name="location_id"/></strong> <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>
<div class="mb4"> </t>
<field name="quantity"/> <field name="product_uom_id" groups="uom.group_uom"/> </templates>
<span class="ms-4" attrs="{'invisible': [('lot_id', '=', False)]}" groups="stock.group_production_lot"> </kanban>
<field name="lot_id"/> </field>
</span> </record>
</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>
<record id="view_stock_quant_tree" model="ir.ui.view"> <record id="view_stock_quant_tree" model="ir.ui.view">
<field name="name">stock_barcode.quant.tree.inherit</field> <field name="name">stock_barcode.quant.tree.inherit</field>
<field name="model">stock.quant</field> <field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree"/> <field name="inherit_id" ref="stock.view_stock_quant_tree"/>
<field name="mode">primary</field> <field name="mode">primary</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='product_uom_id']" position="attributes" > <xpath expr="//field[@name='product_uom_id']" position="attributes">
<attribute name="string">UoM</attribute> <attribute name="string">UoM</attribute>
<attribute name="optional">show</attribute> <attribute name="optional">show</attribute>
</xpath> </xpath>
<xpath expr="//field[@name='available_quantity']" position="attributes" > <xpath expr="//field[@name='available_quantity']" position="attributes">
<attribute name="optional">hide</attribute> <attribute name="optional">hide</attribute>
</xpath> </xpath>
<xpath expr="//field[@name='company_id']" position="attributes" > <xpath expr="//field[@name='company_id']" position="attributes">
<attribute name="optional">hide</attribute> <attribute name="optional">hide</attribute>
</xpath> </xpath>
</field> </field>
</record> </record>
</odoo> </odoo>

View File

@@ -1,181 +1,174 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo><data> <odoo>
<record id="view_stock_move_line_detailed_operation_tree_inherit_stock_barcode" model="ir.ui.view"> <data>
<field name="name">stock.move.line.operations.tree.inherit</field> <record id="view_stock_move_line_kanban_inherited" model="ir.ui.view">
<field name="model">stock.move.line</field> <field name="name">stock.move.line.kanban.inherited</field>
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/> <field name="model">stock.move.line</field>
<field name="arch" type="xml"> <field name="inherit_id" ref="stock.view_stock_move_line_kanban"/>
<xpath expr="//tree" position="inside"> <field name="arch" type="xml">
<field name="product_barcode" invisible="1"/> <xpath expr="//field[@name='qty_done']" position="after">
<field name="location_processed" invisible="1"/> <field name="product_barcode" invisible="1"/>
</xpath> <field name="location_processed" invisible="1"/>
<xpath expr="//field[@name='qty_done']" position="attributes"> <field name="result_package_id" invisible="1"/>
<attribute name="options">{'barcode_events': True}</attribute> <field name="lots_visible" invisible="1"/>
<attribute name="widget">field_float_scannable</attribute> </xpath>
</xpath> </field>
</field> </record>
</record>
<record id="view_stock_move_line_kanban_inherited" model="ir.ui.view"> <record id="stock_picking_barcode" model="ir.ui.view">
<field name="name">stock.move.line.kanban.inherited</field> <field name="name">stock.picking.form.view.barcode</field>
<field name="model">stock.move.line</field> <field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_stock_move_line_kanban"/> <field name="priority">1000</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='qty_done']" position="after"> <form string="Picking Details">
<field name="product_barcode" invisible="1"/> <field name="show_allocation" invisible="1"/>
<field name="location_processed" invisible="1"/> <field name="company_id" invisible="1"/>
<field name="result_package_id" invisible="1"/> <group>
<field name="lots_visible" invisible="1"/> <button name="action_view_reception_report" string="Allocation" type="object"
</xpath> context="{'default_picking_ids': [id]}"
</field> class="btn btn-primary o_reception_report" icon="fa-list"
</record> attrs="{'invisible': [('show_allocation', '=', False)]}"
groups="stock.group_reception_report"/>
<record id="stock_picking_barcode" model="ir.ui.view"> <field name="partner_id"/>
<field name="name">stock.picking.form.view.barcode</field> <field name="scheduled_date" readonly="1"
<field name="model">stock.picking</field> attrs="{'invisible': [('scheduled_date', '=', False)]}"/>
<field name="priority">1000</field> <field name="origin" readonly="1" attrs="{'invisible': [('origin', '=', False)]}"/>
<field name="arch" type="xml"> <field name="state" readonly="1" attrs="{'invisible': [('state', '=', False)]}"/>
<form string="Picking Details"> <field name="priority" readonly="1" attrs="{'invisible': [('priority', '=', False)]}"/>
<field name="show_allocation" invisible="1"/> <field name="owner_id" readonly="1" attrs="{'invisible': [('owner_id', '=', False)]}"
<field name="company_id" invisible="1"/> groups="stock.group_tracking_owner"/>
<group> <field name="company_id" readonly="1" groups="base.group_multi_company"/>
<button name="action_view_reception_report" string="Allocation" type="object" <field name="move_ids" readonly="1" attrs="{'invisible': [('move_ids', '=', False)]}">
context="{'default_picking_ids': [id]}" <kanban>
class="btn btn-primary o_reception_report" icon="fa-list" <templates>
attrs="{'invisible': [('show_allocation', '=', False)]}" <t t-name="kanban-box">
groups="stock.group_reception_report"/> <div class="oe_kanban_global_click">
<field name="partner_id"/> <div class="row">
<field name="scheduled_date" readonly="1" attrs="{'invisible': [('scheduled_date', '=', False)]}"/> <div class="col-6 o_kanban_record_title">
<field name="origin" readonly="1" attrs="{'invisible': [('origin', '=', False)]}"/> <field name="product_id"/>
<field name="state" readonly="1" attrs="{'invisible': [('state', '=', False)]}"/> </div>
<field name="priority" readonly="1" attrs="{'invisible': [('priority', '=', False)]}"/> <div class="col-6 text-end">
<field name="owner_id" readonly="1" attrs="{'invisible': [('owner_id', '=', False)]}" groups="stock.group_tracking_owner"/> <field name="product_uom_qty"/>
<field name="company_id" readonly="1" groups="base.group_multi_company"/> </div>
<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>
<div class="col-6 text-end"> <div class="row">
<field name="product_uom_qty"/> <div class="col-6">
<field name="description_picking"/>
</div>
<div class="col-6 text-end">
<field name="state"/>
</div>
</div> </div>
</div> </div>
<div class="row"> </t>
<div class="col-6"> </templates>
<field name="description_picking"/> </kanban>
</div> </field>
<div class="col-6 text-end"> <field name="note" readonly="1" attrs="{'invisible': [('note', '=', False)]}"/>
<field name="state"/> </group>
</div> <div class="o_barcode_control d-flex fixed-bottom">
</div> <button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
</div> <button string="Confirm" class="btn btn-primary o_save" special="save"/>
</t> </div>
</templates> </form>
</kanban> </field>
</field> </record>
<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"> <record id="open_picking" model="ir.actions.act_window">
<field name="name">Open picking form</field> <field name="name">Open picking form</field>
<field name="res_model">stock.picking</field> <field name="res_model">stock.picking</field>
<field name="view_mode">form</field> <field name="view_mode">form</field>
<field name="context">{ <field name="context">{
'res_id': active_id, 'res_id': active_id,
} }
</field> </field>
</record> </record>
<record id="picking_view_kanban_inherit_barcode" model="ir.ui.view"> <record id="picking_view_kanban_inherit_barcode" model="ir.ui.view">
<field name="name">stock.picking.view.kanban.barcode</field> <field name="name">stock.picking.view.kanban.barcode</field>
<field name="model">stock.picking</field> <field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.stock_picking_kanban"/> <field name="inherit_id" ref="stock.stock_picking_kanban"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<!-- Use the form view --> <!-- Use the form view -->
<xpath expr="//div[hasclass('o_kanban_record_headings')]" position="after"> <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"/> <button style="padding: 0px 10px;" class="btn btn-link fa fa-desktop" title="Open picking"
</xpath> name="action_open_picking" type="object"/>
</xpath>
<!-- Use mobile view--> <!-- Use mobile view-->
<xpath expr="//strong[hasclass('o_kanban_record_title')]" position="replace"> <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" <button style="padding: 0px 0px;" class="btn btn-link o_kanban_record_title"
type="object"> name="action_open_picking_client_action"
<span><t t-esc="record.name.value"/></span> type="object">
</button> <span>
</xpath> <t t-esc="record.name.value"/>
</field> </span>
</record> </button>
</xpath>
</field>
</record>
<record id="view_picking_type_form_inherit_stock_barcode" model="ir.ui.view"> <record id="view_picking_type_form_inherit_stock_barcode" model="ir.ui.view">
<field name="name">Operation Types</field> <field name="name">Operation Types</field>
<field name="model">stock.picking.type</field> <field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_form"/> <field name="inherit_id" ref="stock.view_picking_type_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='warehouse_id']" position="after"> <xpath expr="//field[@name='warehouse_id']" position="after">
<field name="barcode"/> <field name="barcode"/>
</xpath> </xpath>
</field> </field>
</record> </record>
<record id="stock_barcode_view_picking_type_form" model="ir.ui.view"> <record id="stock_barcode_view_picking_type_form" model="ir.ui.view">
<field name="name">Operation Types</field> <field name="name">Operation Types</field>
<field name="model">stock.picking.type</field> <field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_form"/> <field name="inherit_id" ref="stock.view_picking_type_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//sheet//group[@name='first']" position="before"> <xpath expr="//sheet//group[@name='first']" position="before">
<notebook> <notebook>
<page name="general" string="General"> <page name="general" string="General">
</page> </page>
<page name="barcode_app" string="Barcode App"> <page name="barcode_app" string="Barcode App">
<group name="restrict_scan_settings" string="Mandatory Scan"> <group name="restrict_scan_settings" string="Mandatory Scan">
<field name="restrict_scan_source_location" string="Source Location" <field name="restrict_scan_source_location" string="Source Location"
groups="stock.group_stock_multi_locations" groups="stock.group_stock_multi_locations"
attrs="{'invisible': [('code', '=', 'incoming')]}"/> attrs="{'invisible': [('code', '=', 'incoming')]}"/>
<field name="restrict_scan_product" string="Product"/> <field name="restrict_scan_product" string="Product"/>
<field name="restrict_scan_tracking_number" string="Lot/Serial" <field name="restrict_scan_tracking_number" string="Lot/Serial"
groups="stock.group_production_lot"/> groups="stock.group_production_lot"/>
<field name="restrict_put_in_pack" <field name="restrict_put_in_pack"
groups="stock.group_tracking_lot" string="Put in Pack"/> groups="stock.group_tracking_lot" string="Put in Pack"/>
<field name="restrict_scan_dest_location" string="Destination Location" <field name="restrict_scan_dest_location" string="Destination Location"
groups="stock.group_stock_multi_locations" groups="stock.group_stock_multi_locations"
attrs="{'invisible': [('code', '=', 'outgoing')]}"/> attrs="{'invisible': [('code', '=', 'outgoing')]}"/>
</group> </group>
<field name="show_barcode_validation" invisible="1"/> <field name="show_barcode_validation" invisible="1"/>
<group name="barcode_validation" string="Final Validation" attrs="{'invisible': [('show_barcode_validation', '=', False)]}"> <group name="barcode_validation" string="Final Validation"
<!-- show_barcode_validation handles combined groups/invisible complexity --> attrs="{'invisible': [('show_barcode_validation', '=', False)]}">
<field name="barcode_validation_full" <!-- show_barcode_validation handles combined groups/invisible complexity -->
attrs="{'invisible': [('restrict_scan_product', '=', True)]}"/> <field name="barcode_validation_full"
<field name="barcode_validation_all_product_packed" attrs="{'invisible': [('restrict_scan_product', '=', True)]}"/>
groups="stock.group_tracking_lot" <field name="barcode_validation_all_product_packed"
attrs="{'invisible': [('restrict_put_in_pack', '!=', 'optional')]}"/> groups="stock.group_tracking_lot"
<field name="barcode_validation_after_dest_location" attrs="{'invisible': [('restrict_put_in_pack', '!=', 'optional')]}"/>
groups="stock.group_stock_multi_locations" <field name="barcode_validation_after_dest_location"
attrs="{'invisible': ['|', groups="stock.group_stock_multi_locations"
attrs="{'invisible': ['|',
('code', '=', 'outgoing'), ('code', '=', 'outgoing'),
('restrict_scan_dest_location', '!=', 'optional'), ('restrict_scan_dest_location', '!=', 'optional'),
]}"/> ]}"/>
</group> </group>
</page> </page>
</notebook> </notebook>
</xpath> </xpath>
<xpath expr="//page[@name='general']" position="inside"> <xpath expr="//page[@name='general']" position="inside">
<xpath expr="//sheet//group[@name='first']" position="move"/> <xpath expr="//sheet//group[@name='first']" position="move"/>
</xpath> </xpath>
<xpath expr="//page[@name='general']" position="inside"> <xpath expr="//page[@name='general']" position="inside">
<xpath expr="//sheet//group[@name='second']" position="move"/> <xpath expr="//sheet//group[@name='second']" position="move"/>
</xpath> </xpath>
</field> </field>
</record> </record>
</data></odoo> </data>
</odoo>