From 0b149486c45f6a5e1ddaba5cc6f6c45cdcdae40f Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Thu, 27 Feb 2020 21:57:37 +0100 Subject: [PATCH] incoterms --- .../models/intrastat_product_declaration.py | 8 +-- intrastat_product/models/res_company.py | 9 +-- .../models/res_config_settings.py | 5 +- intrastat_product/views/account_move.xml | 60 ++++++------------- .../views/res_config_settings.xml | 4 -- oca_dependencies.txt | 1 + 6 files changed, 22 insertions(+), 65 deletions(-) create mode 100644 oca_dependencies.txt diff --git a/intrastat_product/models/intrastat_product_declaration.py b/intrastat_product/models/intrastat_product_declaration.py index 1716798..be35e25 100644 --- a/intrastat_product/models/intrastat_product_declaration.py +++ b/intrastat_product/models/intrastat_product_declaration.py @@ -1,11 +1,10 @@ # Copyright 2011-2017 Akretion France (http://www.akretion.com) -# Copyright 2009-2018 Noviat (http://www.noviat.com) +# Copyright 2009-2020 Noviat (http://www.noviat.com) # @author Alexis de Lattre # @author Luc de Meyer import logging from datetime import date, datetime - from dateutil.relativedelta import relativedelta from odoo import _, api, fields, models @@ -417,11 +416,8 @@ class IntrastatProductDeclaration(models.Model): return transport def _get_incoterm(self, inv_line): - # WARNING for v12: there are 2 incoterm fields on account.invoice - # cf https://github.com/odoo/odoo/issues/31641 - # the field to use is 'incoterm_id' defined in the 'account' module incoterm = ( - inv_line.invoice_id.incoterm_id or self.company_id.intrastat_incoterm_id + inv_line.invoice_id.invoice_incoterm_id or self.company_id.incoterm_id ) if not incoterm: msg = _( diff --git a/intrastat_product/models/res_company.py b/intrastat_product/models/res_company.py index 70e361b..14e3fa7 100644 --- a/intrastat_product/models/res_company.py +++ b/intrastat_product/models/res_company.py @@ -1,5 +1,5 @@ # Copyright 2011-2017 Akretion (http://www.akretion.com) -# Copyright 2009-2018 Noviat (http://www.noviat.com) +# Copyright 2009-2020 Noviat (http://www.noviat.com) # @author Alexis de Lattre # @author Luc de Meyer @@ -9,13 +9,6 @@ from odoo import api, fields, models class ResCompany(models.Model): _inherit = "res.company" - intrastat_incoterm_id = fields.Many2one( - comodel_name="account.incoterms", - string="Default Incoterm for Intrastat", - help="International Commercial Terms are a series of " - "predefined commercial terms used in international " - "transactions.", - ) intrastat_arrivals = fields.Selection( selection="_intrastat_arrivals", string="Arrivals", diff --git a/intrastat_product/models/res_config_settings.py b/intrastat_product/models/res_config_settings.py index 19605e0..cac16a3 100644 --- a/intrastat_product/models/res_config_settings.py +++ b/intrastat_product/models/res_config_settings.py @@ -1,5 +1,5 @@ # Copyright 2017 Akretion (Alexis de Lattre ) -# Copyright 2009-2018 Noviat (http://www.noviat.com) +# Copyright 2009-2020 Noviat (http://www.noviat.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import fields, models @@ -8,9 +8,6 @@ from odoo import fields, models class ResConfigSettings(models.TransientModel): _inherit = "res.config.settings" - intrastat_incoterm_id = fields.Many2one( - related="company_id.intrastat_incoterm_id", readonly=False - ) intrastat_arrivals = fields.Selection( related="company_id.intrastat_arrivals", readonly=False ) diff --git a/intrastat_product/views/account_move.xml b/intrastat_product/views/account_move.xml index 4fb65a7..9f28158 100644 --- a/intrastat_product/views/account_move.xml +++ b/intrastat_product/views/account_move.xml @@ -2,49 +2,23 @@ - intrastat.invoice.form - account.move - - - - - - - - - - - - - + intrastat.invoice.form + account.move + + + + + + + + + + + + + - - diff --git a/intrastat_product/views/res_config_settings.xml b/intrastat_product/views/res_config_settings.xml index 8002276..f548e2b 100644 --- a/intrastat_product/views/res_config_settings.xml +++ b/intrastat_product/views/res_config_settings.xml @@ -34,10 +34,6 @@