You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
408 B
13 lines
408 B
from django import forms
|
|
from .models import GoodsReception
|
|
|
|
class GoodsReceptionForm(forms.ModelForm):
|
|
class Meta:
|
|
model = GoodsReception
|
|
fields = '__all__'
|
|
|
|
def clean(self):
|
|
cleaned_data = super().clean()
|
|
if not cleaned_data.get('quality_check') or not cleaned_data.get('shelf_life_valid'):
|
|
cleaned_data['is_accepted'] = False
|
|
return cleaned_data |