Allow to require invoice name only

This commit is contained in:
Raphael Michel
2018-05-11 12:52:11 +02:00
parent 1b9bfb5b62
commit 008b4a134b
12 changed files with 181 additions and 38 deletions

View File

@@ -242,3 +242,12 @@ class BaseInvoiceAddressForm(forms.ModelForm):
'resolve this manually.'))
else:
self.instance.vat_id_validated = False
class BaseInvoiceNameForm(BaseInvoiceAddressForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for f in list(self.fields.keys()):
if f != 'name':
del self.fields[f]