diff --git a/intrastat_product/__openerp__.py b/intrastat_product/__openerp__.py index c559fe3..3e04803 100644 --- a/intrastat_product/__openerp__.py +++ b/intrastat_product/__openerp__.py @@ -1,30 +1,11 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat Product module for Odoo -# Copyright (C) 2011-2015 Akretion (http://www.akretion.com) -# Copyright (C) 2009-2015 Noviat (http://www.noviat.com) -# @author Alexis de Lattre -# @author Luc de Meyer -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2011-2017 Akretion (http://www.akretion.com) +# Copyright 2009-2017 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Intrastat Product', - 'version': '8.0.1.4.1', + 'version': '8.0.1.5.0', 'category': 'Intrastat', 'license': 'AGPL-3', 'summary': 'Base module for Intrastat Product', @@ -35,7 +16,7 @@ 'stock_picking_invoice_link', 'sale_stock', 'purchase', - ], + ], 'conflicts': ['report_intrastat'], 'data': [ 'views/hs_code.xml', diff --git a/intrastat_product/models/account_invoice.py b/intrastat_product/models/account_invoice.py index 080d1df..a4f31bc 100644 --- a/intrastat_product/models/account_invoice.py +++ b/intrastat_product/models/account_invoice.py @@ -1,28 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat Product module for Odoo -# Copyright (C) 2011-2016 Akretion (http://www.akretion.com) -# Copyright (C) 2009-2016 Noviat (http://www.noviat.com) -# @author Alexis de Lattre -# @author Luc de Meyer -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2011-2017 Akretion (http://www.akretion.com) +# Copyright 2009-2017 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from openerp import api, fields, models class AccountInvoice(models.Model): @@ -43,6 +24,8 @@ class AccountInvoice(models.Model): src_dest_country_id = fields.Many2one( 'res.country', string='Origin/Destination Country', ondelete='restrict') + company_country_code = fields.Char( + related='company_id.country_id.code', readonly=True) src_dest_region_id = fields.Many2one( 'intrastat.region', string='Origin/Destination Region', default=lambda self: self._default_src_dest_region_id(), diff --git a/intrastat_product/models/res_company.py b/intrastat_product/models/res_company.py index 2995486..58e713b 100644 --- a/intrastat_product/models/res_company.py +++ b/intrastat_product/models/res_company.py @@ -1,28 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat Product module for Odoo -# Copyright (C) 2011-2015 Akretion (http://www.akretion.com) -# Copyright (C) 2009-2015 Noviat (http://www.noviat.com) -# @author Alexis de Lattre -# @author Luc de Meyer -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2011-2017 Akretion (http://www.akretion.com) +# Copyright 2009-2017 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from openerp import api, fields, models class ResCompany(models.Model): @@ -46,6 +27,8 @@ class ResCompany(models.Model): intrastat = fields.Char( string='Intrastat Declaration', store=True, readonly=True, compute='_compute_intrastat') + country_code = fields.Char( + related='country_id.code', readonly=True) intrastat_region_id = fields.Many2one( 'intrastat.region', string='Default Intrastat Region') diff --git a/intrastat_product/models/stock_warehouse.py b/intrastat_product/models/stock_warehouse.py index 90509b8..2cedd7c 100644 --- a/intrastat_product/models/stock_warehouse.py +++ b/intrastat_product/models/stock_warehouse.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Odoo, Open Source Management Solution -# -# Copyright (c) 2009-2015 Noviat nv/sa (www.noviat.com). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2009-2017 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from openerp import api, fields, models class StockWarehouse(models.Model): @@ -29,6 +11,8 @@ class StockWarehouse(models.Model): region_id = fields.Many2one( 'intrastat.region', string='Intrastat region') + country_code = fields.Char( + related='company_id.country_id.code', readonly=True) class StockLocation(models.Model): diff --git a/intrastat_product/views/account_invoice.xml b/intrastat_product/views/account_invoice.xml index 26332cd..10fbc87 100644 --- a/intrastat_product/views/account_invoice.xml +++ b/intrastat_product/views/account_invoice.xml @@ -18,7 +18,9 @@ attrs="{'invisible': [('intrastat', '!=', 'extended')]}" widget="selection"/> - + + @@ -42,7 +44,9 @@ attrs="{'invisible': [('intrastat', '!=', 'extended')]}" widget="selection"/> - + + diff --git a/intrastat_product/views/res_company.xml b/intrastat_product/views/res_company.xml index 2d61383..40c5b7f 100644 --- a/intrastat_product/views/res_company.xml +++ b/intrastat_product/views/res_company.xml @@ -15,7 +15,9 @@ - + + diff --git a/intrastat_product/views/stock_warehouse.xml b/intrastat_product/views/stock_warehouse.xml index 163cf0f..71f33fa 100644 --- a/intrastat_product/views/stock_warehouse.xml +++ b/intrastat_product/views/stock_warehouse.xml @@ -8,7 +8,8 @@ - + +