From 85f502b27f80feca6b1666bed3bf5417faff6bba Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 24 Jul 2017 14:46:26 +0200 Subject: [PATCH] [FIX] Intrastat Transaction Type for refunds created from an invoice via the wizard --- intrastat_product/models/account_invoice.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/intrastat_product/models/account_invoice.py b/intrastat_product/models/account_invoice.py index b62d4db..5debbc9 100644 --- a/intrastat_product/models/account_invoice.py +++ b/intrastat_product/models/account_invoice.py @@ -34,7 +34,6 @@ class AccountInvoice(models.Model): "commercial terms used in international transactions.") intrastat_transaction_id = fields.Many2one( 'intrastat.transaction', string='Intrastat Transaction Type', - default=lambda self: self._default_intrastat_transaction_id(), ondelete='restrict', help="Intrastat nature of transaction") intrastat_transport_id = fields.Many2one( @@ -64,23 +63,6 @@ class AccountInvoice(models.Model): or inv.partner_id.country_id inv.intrastat_country = country.intrastat - @api.model - def _default_intrastat_transaction_id(self): - company = self.env['res.company'] - company_id = company._company_default_get('account.invoice') - company = company.browse(company_id) - inv_type = self._context.get('type') - if inv_type == 'out_invoice': - return company.intrastat_transaction_out_invoice - elif inv_type == 'out_refund': - return company.intrastat_transaction_out_refund - elif inv_type == 'in_invoice': - return company.intrastat_transaction_in_invoice - elif inv_type == 'in_refund': - return company.intrastat_transaction_in_refund - else: - return self.env['intrastat.transaction'] - @api.model def _default_src_dest_region_id(self): rco = self.env['res.company']