mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
[FIX] intrastat_product: state can be None
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
{
|
||||
'name': 'Intrastat Product',
|
||||
'version': '10.0.1.0.0',
|
||||
'version': '10.0.1.1.0',
|
||||
'category': 'Intrastat',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Base module for Intrastat Product',
|
||||
|
||||
@@ -177,6 +177,9 @@ class IntrastatProductDeclaration(models.Model):
|
||||
def _compute_company_country_code(self):
|
||||
for this in self:
|
||||
if this.company_id:
|
||||
if not this.company_id.country_id:
|
||||
raise ValidationError(
|
||||
_("You must set company's country !"))
|
||||
this.company_country_code = \
|
||||
this.company_id.country_id.code.lower()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user