diff --git a/base_continent/__init__.py b/base_continent/__init__.py new file mode 100644 index 000000000..89a35d724 --- /dev/null +++ b/base_continent/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Author: Romain Deheele +# Copyright 2014 Camptocamp SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import base_continent +from . import country +from . import partner diff --git a/base_continent/__openerp__.py b/base_continent/__openerp__.py new file mode 100644 index 000000000..d0e25dd02 --- /dev/null +++ b/base_continent/__openerp__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Romain Deheele +# Copyright 2014 Camptocamp SA +# +# 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 . +# +############################################################################## + + +{ + 'name': 'Continent management', + 'version': '1.0', + 'depends': ['base'], + 'author': 'Camptocamp', + 'license': 'AGPL-3', + 'description': """ +This module introduces continent management. +============================================ +Links continents to countries, +adds continent field on partner form +""", + 'category': 'Generic Modules/Base', + 'data': [ + 'base_continent_view.xml', + 'base_continent_data.xml', + 'security/ir.model.access.csv'], + 'active': False, + 'installable': True, +} diff --git a/base_continent/base_continent.py b/base_continent/base_continent.py new file mode 100644 index 000000000..c48051841 --- /dev/null +++ b/base_continent/base_continent.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Romain Deheele +# Copyright 2014 Camptocamp SA +# +# 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.orm import Model +from openerp.osv import fields + + +class Continent(Model): + _name = 'res.continent' + _description = 'Continent' + _columns = { + 'name': fields.char('Continent Name', size=64, + help='The full name of the continent.', + required=True, translate=True), + } + _order = 'name' diff --git a/base_continent/base_continent_data.xml b/base_continent/base_continent_data.xml new file mode 100644 index 000000000..555c433ea --- /dev/null +++ b/base_continent/base_continent_data.xml @@ -0,0 +1,27 @@ + + + + + + Africa + + + Antarctica + + + Asia + + + Europe + + + North America + + + Oceania + + + South America + + + diff --git a/base_continent/base_continent_view.xml b/base_continent/base_continent_view.xml new file mode 100644 index 000000000..7522bbf01 --- /dev/null +++ b/base_continent/base_continent_view.xml @@ -0,0 +1,73 @@ + + + + + + res.country.tree.add_continent + res.country + + + + + + + + + + + res.country.form.add_continent + res.country + + + + + + + + + + res.continent.tree + res.continent + + + + + + + + + res.continent.form + res.continent + +
+ + + +
+
+
+ + + Continents + ir.actions.act_window + res.continent + form + Display and manage the list of all continents that can be assigned to your partner records. + + + + + + + res.partner.form.add_continent + res.partner + + + + + + + + +
+
diff --git a/base_continent/country.py b/base_continent/country.py new file mode 100644 index 000000000..b4395763b --- /dev/null +++ b/base_continent/country.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Romain Deheele +# Copyright 2014 Camptocamp SA +# +# 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.orm import Model +from openerp.osv import fields + + +class Country(Model): + _inherit = 'res.country' + _columns = { + 'continent_id': fields.many2one('res.continent', 'Continent'), + } diff --git a/base_continent/i18n/base_continent.po b/base_continent/i18n/base_continent.po new file mode 100644 index 000000000..d758f85de --- /dev/null +++ b/base_continent/i18n/base_continent.po @@ -0,0 +1,56 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_continent +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-14 15:19+0000\n" +"PO-Revision-Date: 2014-01-14 15:19+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: base_continent +#: model:ir.actions.act_window,help:base_continent.action_continent +msgid "Display and manage the list of all continents that can be assigned to your partner records." +msgstr "" + +#. module: base_continent +#: model:ir.actions.act_window,name:base_continent.action_continent +#: model:ir.ui.menu,name:base_continent.menu_continent_partner +msgid "Continents" +msgstr "" + +#. module: base_continent +#: model:ir.model,name:base_continent.model_res_country +msgid "Country" +msgstr "" + +#. module: base_continent +#: help:res.continent,name:0 +msgid "The full name of the continent." +msgstr "" + +#. module: base_continent +#: field:res.continent,name:0 +msgid "Continent Name" +msgstr "" + +#. module: base_continent +#: model:ir.model,name:base_continent.model_res_partner +msgid "Partner" +msgstr "" + +#. module: base_continent +#: model:ir.model,name:base_continent.model_res_continent +#: view:res.continent:0 +#: field:res.country,continent_id:0 +#: field:res.partner,continent_id:0 +msgid "Continent" +msgstr "" + diff --git a/base_continent/i18n/fr.po b/base_continent/i18n/fr.po new file mode 100644 index 000000000..1925f16aa --- /dev/null +++ b/base_continent/i18n/fr.po @@ -0,0 +1,56 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_continent +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-14 15:19+0000\n" +"PO-Revision-Date: 2014-01-14 15:19+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: base_continent +#: model:ir.actions.act_window,help:base_continent.action_continent +msgid "Display and manage the list of all continents that can be assigned to your partner records." +msgstr "Affiche et gère la liste de tous les continents qui peuvent être associés à vos partenaires." + +#. module: base_continent +#: model:ir.actions.act_window,name:base_continent.action_continent +#: model:ir.ui.menu,name:base_continent.menu_continent_partner +msgid "Continents" +msgstr "Continents" + +#. module: base_continent +#: model:ir.model,name:base_continent.model_res_country +msgid "Country" +msgstr "Pays" + +#. module: base_continent +#: help:res.continent,name:0 +msgid "The full name of the continent." +msgstr "Le nom complet du continent." + +#. module: base_continent +#: field:res.continent,name:0 +msgid "Continent Name" +msgstr "Nom du continent" + +#. module: base_continent +#: model:ir.model,name:base_continent.model_res_partner +msgid "Partner" +msgstr "Partenaire" + +#. module: base_continent +#: model:ir.model,name:base_continent.model_res_continent +#: view:res.continent:0 +#: field:res.country,continent_id:0 +#: field:res.partner,continent_id:0 +msgid "Continent" +msgstr "Continent" + diff --git a/base_continent/partner.py b/base_continent/partner.py new file mode 100644 index 000000000..a5656652c --- /dev/null +++ b/base_continent/partner.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Romain Deheele +# Copyright 2014 Camptocamp SA +# +# 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.orm import Model +from openerp.osv import fields + + +class Partner(Model): + _inherit = 'res.partner' + _columns = { + 'continent_id': fields.related('country_id', 'continent_id', + type='many2one', + relation='res.continent', + string='Continent', + readonly=True, store=True), + } diff --git a/base_continent/security/ir.model.access.csv b/base_continent/security/ir.model.access.csv new file mode 100644 index 000000000..69ee73366 --- /dev/null +++ b/base_continent/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_res_continent_group_all,res_continent group_user_all,model_res_continent,,1,0,0,0 +access_res_continent_group_user,res_continent group_user,model_res_continent,base.group_partner_manager,1,1,1,1