mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
intrastat declaration - restore _compute_numbers that was dropped by PR #149 (removal of intrastat.common
This commit is contained in:
committed by
Alexis de Lattre
parent
a576b93879
commit
3f62a5dd33
@@ -204,6 +204,17 @@ class IntrastatProductDeclaration(models.Model):
|
||||
for this in self:
|
||||
this.valid = True
|
||||
|
||||
@api.depends("declaration_line_ids.amount_company_currency")
|
||||
def _compute_numbers(self):
|
||||
for this in self:
|
||||
total_amount = 0 # it is an integer
|
||||
num_lines = 0
|
||||
for line in this.declaration_line_ids:
|
||||
total_amount += line.amount_company_currency
|
||||
num_lines += 1
|
||||
this.num_decl_lines = num_lines
|
||||
this.total_amount = total_amount
|
||||
|
||||
@api.constrains("year")
|
||||
def _check_year(self):
|
||||
for this in self:
|
||||
|
||||
Reference in New Issue
Block a user