Explorar el Código

all product process

tum hace 11 meses
padre
commit
203194ffe1
Se han modificado 5 ficheros con 48 adiciones y 4 borrados
  1. 9 1
      app/core/filters.py
  2. 3 0
      app/core/models.py
  3. 7 1
      app/legacy/urls.py
  4. 26 2
      app/legacy/views.py
  5. 3 0
      app/templates/base.html

+ 9 - 1
app/core/filters.py

@@ -1,5 +1,5 @@
1 1
 import django_filters
2
-from .models import VMasterView, MgMasterView, BelMasterView, EMasterView
2
+from .models import VMasterView, MgMasterView, BelMasterView, EMasterView, AllProductDimensionForInsProcess
3 3
 
4 4
 class VMasterViewFilter(django_filters.FilterSet):
5 5
     """
@@ -64,3 +64,11 @@ class EMasterViewFilter(django_filters.FilterSet):
64 64
     class Meta:
65 65
         model = EMasterView
66 66
         fields = ['pro1', 'pro2']  # Add other fields to filter as needed
67
+
68
+
69
+class AllProductDimensionForInsProcessFilter(django_filters.FilterSet):
70
+    ProductCode = django_filters.CharFilter(field_name='ProductCode', lookup_expr='icontains')
71
+
72
+    class Meta:
73
+        model = AllProductDimensionForInsProcess
74
+        fields = ["ProductCode"]

+ 3 - 0
app/core/models.py

@@ -393,6 +393,7 @@ class AllProductAverageObMinMaxView(models.Model):
393 393
 
394 394
     class Meta:
395 395
         managed = False  # This model corresponds to a database view
396
+        app_label = "legacy"
396 397
         db_table = 'AllProduct_Average_OB_MIN_MAX_view'  # Name of the database view
397 398
 
398 399
 class AllProductDimensionForInsProcess(models.Model):
@@ -406,6 +407,7 @@ class AllProductDimensionForInsProcess(models.Model):
406 407
 
407 408
     class Meta:
408 409
         managed = False  # This model corresponds to a database view
410
+        app_label = "legacy"
409 411
         db_table = 'AllProduct_Dimension_ForInsProcess'  # Name of the database view
410 412
 
411 413
 class AllProductPressPositionPressWeight(models.Model):
@@ -437,4 +439,5 @@ class AllProductPressPositionPressWeight(models.Model):
437 439
 
438 440
     class Meta:
439 441
         managed = False  # This model corresponds to a database view
442
+        app_label = "legacy"
440 443
         db_table = 'AllProduct_PressPosition_PressWeight'  # Name of the database view

+ 7 - 1
app/legacy/urls.py

@@ -2,7 +2,7 @@ from django.urls import path
2 2
 from .views import DataListView, DataDetailView, DataCreateView, DataUpdateView, DataDeleteView,\
3 3
 DataMsCRUDView, TbFgPressInfoLotListCRUDView, LotSummaryCRUDView, VMasterViewCRUDView, MgMasterViewCRUDView,\
4 4
 BelMasterViewCRUDView, EMasterViewCRUDView, DataRLCRUDView, DataWbCRUDView, LotSummaryRlCRUDView, \
5
-LotSummaryWbCRUDView, RotateDataCRUDView, ManualsizeCRUDView
5
+LotSummaryWbCRUDView, RotateDataCRUDView, ManualsizeCRUDView, AllProductDimensionForInsProcessCRUDView
6 6
 
7 7
 app_name = 'legacy'  # Namespace for this app
8 8
 
@@ -19,6 +19,7 @@ lsrl_crud = LotSummaryRlCRUDView()
19 19
 lswb_crud = LotSummaryWbCRUDView()
20 20
 rotate_crud = RotateDataCRUDView()
21 21
 manualsize_crud = ManualsizeCRUDView()
22
+allproductdimension_crud = AllProductDimensionForInsProcessCRUDView()
22 23
 
23 24
 urlpatterns = [
24 25
     path('data/', DataListView.as_view(), name='data-list'),            # data/
@@ -92,4 +93,9 @@ urlpatterns = [
92 93
     path('manualsize/create/', manualsize_crud.get_create_view().as_view(), name='manualsize-create'),
93 94
     path('manualsize/<str:pk>/update/', manualsize_crud.get_update_view().as_view(), name='manualsize-update'),
94 95
     path('manualsize/<str:pk>/delete/', manualsize_crud.get_delete_view().as_view(), name='manualsize-delete'),
96
+    
97
+    path('allproductdimension/', allproductdimension_crud.get_list_view().as_view(), name='allproductdimension-list'),
98
+    path('allproductdimension/create/', allproductdimension_crud.get_create_view().as_view(), name='allproductdimension-create'),
99
+    path('allproductdimension/<str:pk>/update/', allproductdimension_crud.get_update_view().as_view(), name='allproductdimension-update'),
100
+    path('allproductdimension/<str:pk>/delete/', allproductdimension_crud.get_delete_view().as_view(), name='allproductdimension-delete'),
95 101
 ]

+ 26 - 2
app/legacy/views.py

@@ -18,8 +18,10 @@ from .filters import DataFilter, DataMsFilter, TbFgPressFilter, LotSummaryFilter
18 18
 from django.urls import reverse
19 19
 from django.contrib import messages
20 20
 from pprint import pprint
21
-from core.models import VMasterView, MgMasterView, BelMasterView, EMasterView
22
-from core.filters import VMasterViewFilter, MgMasterViewFilter, BelMasterViewFilter, EMasterViewFilter
21
+from core.models import VMasterView, MgMasterView, BelMasterView, EMasterView, \
22
+        AllProductDimensionForInsProcess
23
+from core.filters import VMasterViewFilter, MgMasterViewFilter, BelMasterViewFilter, EMasterViewFilter,\
24
+        AllProductDimensionForInsProcessFilter
23 25
 
24 26
 from core.utils import ConfigurableCRUDView
25 27
 
@@ -417,3 +419,25 @@ class ManualsizeCRUDView(ConfigurableCRUDView):
417 419
     # Define the order of fields to be displayed
418 420
     config_field_orders = ["lotno", "size_name", "std", "tolun", "tolup", "created_at", "productcode"]
419 421
 
422
+class AllProductDimensionForInsProcessCRUDView(ConfigurableCRUDView):
423
+    model = AllProductDimensionForInsProcess
424
+    list_template_name = 'legacy/datacrud_list.html'
425
+    detail_template_name = 'legacy/datacrud_detail.html'
426
+    form_template_name = 'legacy/datacrud_form.html'
427
+    confirm_delete_template_name = 'legacy/datacrud_confirm_delete.html'
428
+
429
+    filterset_class = AllProductDimensionForInsProcessFilter  # If a filter is needed
430
+
431
+    page_title = "All Product Dimension for Inspection Process"
432
+
433
+    # URL name mappings
434
+    list_url_name = 'legacy:allproductdimension-list'
435
+    create_url_name = 'legacy:allproductdimension-create'
436
+    update_url_name = 'legacy:allproductdimension-update'
437
+    delete_url_name = 'legacy:allproductdimension-delete'
438
+
439
+    # Define the order of fields to be displayed
440
+    config_field_orders = ["ProdType", "ProductCode", "Size_Id", "Size_Name", "Std", "TolUn", "TolUp"]
441
+
442
+    # Exclude fields if necessary
443
+

+ 3 - 0
app/templates/base.html

@@ -123,6 +123,9 @@
123 123
                           <li>
124 124
                             <a href="{% url "legacy:manualsize-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Manual Size</a>
125 125
                           </li>
126
+                          <li>
127
+                            <a href="{% url "legacy:allproductdimension-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Product Dimension</a>
128
+                          </li>
126 129
                     </ul>
127 130
                  </li>
128 131
                  <li>