diff --git a/intrastat_product/models/account_invoice.py b/intrastat_product/models/account_invoice.py index 4fcc0fe..fcd38fe 100644 --- a/intrastat_product/models/account_invoice.py +++ b/intrastat_product/models/account_invoice.py @@ -53,7 +53,7 @@ class AccountInvoice(models.Model): @api.model def _default_intrastat_transaction_id(self): rco = self.env['res.company'] - company = rco._company_default_get('account.invoice') + company = rco._company_default_get() inv_type = self._context.get('type') if inv_type == 'out_invoice': return company.intrastat_transaction_out_invoice @@ -69,7 +69,7 @@ class AccountInvoice(models.Model): @api.model def _default_src_dest_region_id(self): rco = self.env['res.company'] - company = rco._company_default_get('account.invoice') + company = rco._company_default_get() return company.intrastat_region_id diff --git a/intrastat_product/models/intrastat_product_declaration.py b/intrastat_product/models/intrastat_product_declaration.py index d700233..3eec980 100644 --- a/intrastat_product/models/intrastat_product_declaration.py +++ b/intrastat_product/models/intrastat_product_declaration.py @@ -80,8 +80,7 @@ class IntrastatProductDeclaration(models.Model): company_id = fields.Many2one( 'res.company', string='Company', readonly=True, - default=lambda self: self.env['res.company']._company_default_get( - 'intrastat.product.declaration')) + default=lambda self: self.env['res.company']._company_default_get()) company_country_code = fields.Char( compute='_compute_company_country_code', string='Company Country Code', readonly=True, store=True, @@ -924,29 +923,6 @@ class IntrastatProductDeclarationLine(models.Model): 'res.country', string='Country of Origin of the Product', help="Country of origin of the product i.e. product 'made in ____'") - @api.model - def _prepare_grouped_fields(self, computation_line, fields_to_sum): - """ - This method is DEPRECATED. - You should use the _prepare_grouped_fields method on the - IntrastatProductDeclaration class. - """ - vals = { - 'src_dest_country_id': computation_line.src_dest_country_id.id, - 'intrastat_unit_id': computation_line.intrastat_unit_id.id, - 'hs_code_id': computation_line.hs_code_id.id, - 'transaction_id': computation_line.transaction_id.id, - 'transport_id': computation_line.transport_id.id, - 'region_id': computation_line.region_id.id, - 'parent_id': computation_line.parent_id.id, - 'product_origin_country_id': - computation_line.product_origin_country_id.id, - 'amount_company_currency': 0.0, - } - for field in fields_to_sum: - vals[field] = 0.0 - return vals - def _fields_to_sum(self): """ This method is DEPRECATED. diff --git a/intrastat_product/models/intrastat_region.py b/intrastat_product/models/intrastat_region.py index b385255..84f9537 100644 --- a/intrastat_product/models/intrastat_region.py +++ b/intrastat_product/models/intrastat_region.py @@ -16,8 +16,7 @@ class IntrastatRegion(models.Model): description = fields.Char(string='Description') company_id = fields.Many2one( 'res.company', string='Company', - default=lambda self: self.env['res.company']._company_default_get( - 'intrastat.region')) + default=lambda self: self.env['res.company']._company_default_get()) _sql_constraints = [ ('intrastat_region_code_unique', diff --git a/intrastat_product/models/intrastat_transaction.py b/intrastat_product/models/intrastat_transaction.py index 49fb34a..8d66fe1 100644 --- a/intrastat_product/models/intrastat_transaction.py +++ b/intrastat_product/models/intrastat_transaction.py @@ -20,8 +20,7 @@ class IntrastatTransaction(models.Model): readonly=True, store=True) company_id = fields.Many2one( 'res.company', string='Company', - default=lambda self: self.env['res.company']._company_default_get( - 'intrastat.transaction')) + default=lambda self: self.env['res.company']._company_default_get()) @api.multi @api.depends('code', 'description') diff --git a/intrastat_product/views/res_config_settings.xml b/intrastat_product/views/res_config_settings.xml index 9c6bdbb..cc9c212 100644 --- a/intrastat_product/views/res_config_settings.xml +++ b/intrastat_product/views/res_config_settings.xml @@ -12,48 +12,48 @@ - -
-
-
-
-
-
-
+
+
+
- - - -
+
+
+
+
+
+
+
+
+
+
- +
+
+