diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py index 8e2eaa0..3070e32 100644 --- a/intrastat_base/__init__.py +++ b/intrastat_base/__init__.py @@ -23,6 +23,5 @@ from . import country from . import product from . import tax -from . import partner from . import company from . import intrastat_common diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index 973786b..9661bd8 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -44,6 +44,7 @@ Please contact Alexis de Lattre from Akretion for 'data': [ 'country_data.xml', 'product_view.xml', + 'partner_view.xml', 'country_view.xml', 'tax_view.xml', 'company_view.xml', diff --git a/intrastat_base/partner.py b/intrastat_base/partner.py deleted file mode 100644 index a87c0ed..0000000 --- a/intrastat_base/partner.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Report intrastat base module for OpenERP -# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - -from openerp.osv import orm, fields - - -# We want to have the country field on res_partner always set -# because the selection of invoices for intrastat reports is based -# on the country of the invoice partner ! -class res_partner(orm.Model): - _inherit = 'res.partner' - _columns = { - 'country_id': fields.many2one('res.country', 'Country', required=True), - } diff --git a/intrastat_base/partner_view.xml b/intrastat_base/partner_view.xml new file mode 100644 index 0000000..7dc9f4e --- /dev/null +++ b/intrastat_base/partner_view.xml @@ -0,0 +1,31 @@ + + + + + + + + + + res.partner + + + + {'readonly': [('use_parent_address','=',True)], 'required': True} + + + + {'required': True} + + + + + + +