mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	CUI dependent/nested fields (#5924)
* Added backend changes to support printing options * Pass printing options seperatly via kwargs for easier api refactor later * Implemented printing options in CUI * Fix js linting * Use translations for printing dialog * Support nested fields in CUI * Added docs * Remove plugin and template fields from send printing options * Fix docs * Added tests * Fix tests * Fix options response and added test for it * Fix tests * Bump api version * Update docs * Apply suggestions from code review * Fix api change date * Added dependent field and improved nested object fields on CUI * Fix: cui js style * Fix process field implementation if the 'old' __ syntax is used for nested fields
This commit is contained in:
		| @@ -159,7 +159,8 @@ class LabelPrintMixin(LabelFilterMixin): | ||||
|         # Check the request to determine if the user has selected a label printing plugin | ||||
|         plugin = self.get_plugin(self.request) | ||||
|  | ||||
|         serializer = plugin.get_printing_options_serializer(self.request) | ||||
|         kwargs.setdefault('context', self.get_serializer_context()) | ||||
|         serializer = plugin.get_printing_options_serializer(self.request, *args, **kwargs) | ||||
|  | ||||
|         # if no serializer is defined, return an empty serializer | ||||
|         if not serializer: | ||||
| @@ -226,7 +227,7 @@ class LabelPrintMixin(LabelFilterMixin): | ||||
|             raise ValidationError('Label has invalid dimensions') | ||||
|  | ||||
|         # if the plugin returns a serializer, validate the data | ||||
|         if serializer := plugin.get_printing_options_serializer(request, data=request.data): | ||||
|         if serializer := plugin.get_printing_options_serializer(request, data=request.data, context=self.get_serializer_context()): | ||||
|             serializer.is_valid(raise_exception=True) | ||||
|  | ||||
|         # At this point, we offload the label(s) to the selected plugin. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user