mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Fixes for company serializer
This commit is contained in:
		| @@ -31,6 +31,7 @@ import InvenTree.validators | ||||
|  | ||||
| import common.models | ||||
| import common.settings | ||||
| from common.settings import currency_code_default | ||||
|  | ||||
|  | ||||
| def rename_company_image(instance, filename): | ||||
| @@ -149,6 +150,7 @@ class Company(models.Model): | ||||
|         max_length=3, | ||||
|         verbose_name=_('Currency'), | ||||
|         blank=True, | ||||
|         default=currency_code_default, | ||||
|         help_text=_('Default currency used for this company'), | ||||
|         validators=[InvenTree.validators.validate_currency_code], | ||||
|     ) | ||||
|   | ||||
| @@ -66,7 +66,10 @@ class CompanySerializer(InvenTreeModelSerializer): | ||||
|  | ||||
|     currency = serializers.ChoiceField( | ||||
|         choices=djmoney.settings.CURRENCY_CHOICES, | ||||
|         default=currency_code_default, | ||||
|         initial=currency_code_default, | ||||
|         help_text=_('Default currency used for this supplier'), | ||||
|         label=_('Currency Code'), | ||||
|         required=True, | ||||
|     ) | ||||
|  | ||||
|     class Meta: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user