Show invoice address form once again before generating a new invoice

This commit is contained in:
Raphael Michel
2019-12-06 20:03:22 +01:00
parent 12b9d23efb
commit a74bde60eb
4 changed files with 59 additions and 33 deletions

View File

@@ -2053,6 +2053,13 @@ class InvoiceAddress(models.Model):
self.name_parts = {}
super().save(**kwargs)
@property
def is_empty(self):
return (
not self.name_cached and not self.company and not self.street and not self.zipcode and not self.city
and not self.internal_reference and not self.beneficiary
)
@property
def state_name(self):
sd = pycountry.subdivisions.get(code='{}-{}'.format(self.country, self.state))