mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
total_amount is a sum of integers, so it should be an integer
Add transport mode in computation tree view
This commit is contained in:
@@ -35,7 +35,7 @@ class IntrastatCommon(models.AbstractModel):
|
||||
@api.one
|
||||
@api.depends('declaration_line_ids.amount_company_currency')
|
||||
def _compute_numbers(self):
|
||||
total_amount = 0.0
|
||||
total_amount = 0 # it is an integer
|
||||
num_lines = 0
|
||||
for line in self.declaration_line_ids:
|
||||
total_amount += line.amount_company_currency
|
||||
|
||||
@@ -158,9 +158,8 @@ class IntrastatProductDeclaration(models.Model):
|
||||
num_decl_lines = fields.Integer(
|
||||
compute='_compute_numbers', string='Number of Declaration Lines',
|
||||
store=True, track_visibility='onchange')
|
||||
total_amount = fields.Float(
|
||||
compute='_compute_numbers', digits=dp.get_precision('Account'),
|
||||
string='Total Fiscal Amount', store=True,
|
||||
total_amount = fields.Integer(
|
||||
compute='_compute_numbers', string='Total Fiscal Amount', store=True,
|
||||
help="Total fiscal amount in company currency of the declaration.")
|
||||
currency_id = fields.Many2one(
|
||||
'res.currency', related='company_id.currency_id', readonly=True,
|
||||
|
||||
@@ -188,6 +188,8 @@
|
||||
<field name="suppl_unit_qty"
|
||||
attrs="{'invisible': [('intrastat_unit_id', '=', False)], 'required': [('intrastat_unit_id', '!=', False)]}"/>
|
||||
<field name="intrastat_unit_id"/>
|
||||
<field name="transport_id"
|
||||
attrs="{'required': [('reporting_level', '=', 'extended')], 'invisible': [('reporting_level', '!=', 'extended')]}"/>
|
||||
<field name="region_id" invisible="1"/>
|
||||
<field name="product_origin_country_id" invisible="1" string="Product C/O"/>
|
||||
<field name="invoice_id"/>
|
||||
|
||||
Reference in New Issue
Block a user