diff --git a/README.rst b/README.rst new file mode 100644 index 000000000..b467e6635 --- /dev/null +++ b/README.rst @@ -0,0 +1,19 @@ +Partner Identification Numbers +============================== + +This module allows to manage all sort of identification numbers +and certificates which are assigned to a partner and vary from country +to country + + * Commercial register + * VAT ID (eventually) + * fiscal ID's + * membership numbers + * ... + +Credits +======= + +Contributors +------------ +* Antonio Espinosa diff --git a/__init__.py b/__init__.py index d6a2ac33b..71b720ebd 100644 --- a/__init__.py +++ b/__init__.py @@ -1 +1,29 @@ -import partner_id_number +# -*- coding: utf-8 -*- +# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL +# http://tiny.be +# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH +# http://www.camptocamp.at +# Copyright (C) 2015 Antiun Ingenieria, SL (Madrid, Spain) +# http://www.antiun.com +# Antonio Espinosa +# +# 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 . import models diff --git a/__openerp__.py b/__openerp__.py index 81c81caa3..e8836e1a5 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -1,25 +1,63 @@ -{ 'sequence': 500, -"name" : "Partner Identification Numbers" -, "version" : "0.2" -, "author" : "ChriCar Beteiligungs- und Beratungs- GmbH" -, "website" : "http://www.chricar.at/ChriCar" -, "description" : """This module allows to manage all sort of identification numbers -and certificates which are assigned to a partner and vary from country to country +# -*- coding: utf-8 -*- +# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL +# http://tiny.be +# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH +# http://www.camptocamp.at +# Copyright (C) 2015 Antiun Ingenieria, SL (Madrid, Spain) +# http://www.antiun.com +# Antonio Espinosa +# +# 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 . +# +############################################################################## - * Commercial register - * VAT ID (eventually) - * fiscal ID's - * membership numbers - * ... +{ + # Addon information + 'name': 'Partner Identification Numbers', + 'category': 'Customer Relationship Management', + 'version': '1.0', + 'depends': [ + 'crm', + ], + 'external_dependencies': {}, + # Views templates, pages, menus, options and snippets + 'data': [ + 'views/res_partner_id_category_view.xml', + 'views/res_partner_id_number_view.xml', + 'views/res_partner_view.xml', + 'security/ir.model.access.csv', + ], + # Qweb templates + 'qweb': [ + ], + # Your information + 'author': 'ChriCar Beteiligungs- und Beratungs- GmbH, ' + 'Antiun IngenierĂ­a, SL', + 'maintainer': 'ChriCar Beteiligungs- und Beratungs- GmbH, ' + 'Antiun IngenierĂ­a, SL', + 'website': 'http://www.camptocamp.at, ' + 'http://www.antiun.com', + 'license': 'AGPL-3', + # Technical options + 'demo': [], + 'test': [], + 'installable': True, + # 'auto_install':False, + # 'active':True, -""" -, "category" : "Generic Modules/Others" -, "depends" : ["base"] -, "init_xml" : [] -, "demo" : ["partner_id_number_demo.xml"] -, "data" : ["partner_id_number_view.xml", "security/ir.model.access.csv"] -#, "data" : ["partner_id_number_view.xml","security/ir.model.access.csv"] -, "auto_install" : False -, 'installable': False -, 'application' : False } diff --git a/i18n/chricar_partner_id_number.pot b/i18n/chricar_partner_id_number.pot deleted file mode 100644 index b81eb49a2..000000000 --- a/i18n/chricar_partner_id_number.pot +++ /dev/null @@ -1,122 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * chricar_partner_id_number -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.1rc1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-01-23 22:06+0000\n" -"PO-Revision-Date: 2012-01-23 22:06+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: chricar_partner_id_number -#: view:res.partner:0 -msgid "Ident. Numbers" -msgstr "" - -#. module: chricar_partner_id_number -#: view:res.partner.id_category:0 -msgid "Partner Identification Categories" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner,id_numbers:0 -msgid "Identification Numbers" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner.id_category,code:0 -msgid "Code" -msgstr "" - -#. module: chricar_partner_id_number -#: constraint:res.partner:0 -msgid "Error: Invalid EAN code" -msgstr "" - -#. module: chricar_partner_id_number -#: model:ir.actions.act_window,name:chricar_partner_id_number.action_partner_id_category -#: model:ir.ui.menu,name:chricar_partner_id_number.menu_partner_id_category -msgid "Partner ID Categories" -msgstr "" - -#. module: chricar_partner_id_number -#: model:ir.model,name:chricar_partner_id_number.model_res_partner_id_number -msgid "res.partner.id_number" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner.id_number,date_issued:0 -msgid "Issued" -msgstr "" - -#. module: chricar_partner_id_number -#: view:res.partner.id_number:0 -#: field:res.partner.id_number,comment:0 -msgid "Notes" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner.id_category,name:0 -msgid "ID Number" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner.id_number,valid_from:0 -msgid "Valid From" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner.id_number,state:0 -msgid "State" -msgstr "" - -#. module: chricar_partner_id_number -#: model:ir.model,name:chricar_partner_id_number.model_res_partner_id_category -msgid "res.partner.id_category" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner.id_number,name:0 -msgid "ID-Number" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner.id_number,category_id:0 -msgid "ID-Category" -msgstr "" - -#. module: chricar_partner_id_number -#: model:ir.actions.act_window,name:chricar_partner_id_number.action_partner_id_numbers_form -#: view:res.partner.id_number:0 -msgid "Partner ID Numbers" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner.id_number,valid_until:0 -msgid "Valid Until" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner.id_category,active:0 -#: field:res.partner.id_number,active:0 -msgid "Active" -msgstr "" - -#. module: chricar_partner_id_number -#: model:ir.model,name:chricar_partner_id_number.model_res_partner -#: field:res.partner.id_number,partner_id:0 -msgid "Partner" -msgstr "" - -#. module: chricar_partner_id_number -#: field:res.partner.id_number,partner_issued_id:0 -msgid "Issued by" -msgstr "" - diff --git a/i18n/de.po b/i18n/de.po.old similarity index 100% rename from i18n/de.po rename to i18n/de.po.old diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 000000000..08087f779 --- /dev/null +++ b/models/__init__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL +# http://tiny.be +# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH +# http://www.camptocamp.at +# Copyright (C) 2015 Antiun Ingenieria, SL (Madrid, Spain) +# http://www.antiun.com +# Antonio Espinosa +# +# 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 . import res_partner_id_number +from . import res_partner_id_category +from . import res_partner diff --git a/models/res_partner.py b/models/res_partner.py new file mode 100644 index 000000000..58bc0f6b8 --- /dev/null +++ b/models/res_partner.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL +# http://tiny.be +# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH +# http://www.camptocamp.at +# Copyright (C) 2015 Antiun Ingenieria, SL (Madrid, Spain) +# http://www.antiun.com +# Antonio Espinosa +# +# 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 import models, fields + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + id_numbers = fields.One2many( + comodel_name='res.partner.id_number', inverse_name='partner_id', + string="Identification Numbers") diff --git a/models/res_partner_id_category.py b/models/res_partner_id_category.py new file mode 100644 index 000000000..0ea97114c --- /dev/null +++ b/models/res_partner_id_category.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL +# http://tiny.be +# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH +# http://www.camptocamp.at +# Copyright (C) 2015 Antiun Ingenieria, SL (Madrid, Spain) +# http://www.antiun.com +# Antonio Espinosa +# +# 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 import models, fields + + +class ResPartnerIdCategory(models.Model): + _name = "res.partner.id_category" + _order = "name" + + code = fields.Char(string="Code", size=16, required=True) + name = fields.Char(string="ID name", required=True, translate=True) + active = fields.Boolean(string="Active", default=True) diff --git a/models/res_partner_id_number.py b/models/res_partner_id_number.py new file mode 100644 index 000000000..4c97d0c20 --- /dev/null +++ b/models/res_partner_id_number.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL +# http://tiny.be +# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH +# http://www.camptocamp.at +# Copyright (C) 2015 Antiun Ingenieria, SL (Madrid, Spain) +# http://www.antiun.com +# Antonio Espinosa +# +# 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 import models, fields + + +class ResPartnerIdNumber(models.Model): + _name = "res.partner.id_number" + _order = "name" + + name = fields.Char(string="ID Number", required=True) + category_id = fields.Many2one(string="Category", required=True, + comodel_name='res.partner.id_category') + partner_id = fields.Many2one(string="Partner", required=True, + comodel_name='res.partner') + partner_issued_id = fields.Many2one(string="Issued by", + comodel_name='res.partner') + date_issued = fields.Date(string="Issued on") + valid_from = fields.Date(string="Valid from") + valid_until = fields.Date(string="Valid until") + comment = fields.Text(string="Notes") + state = fields.Char(string="State", size=16) + active = fields.Boolean(string="Active", default=True) diff --git a/partner_id_number.py b/partner_id_number.py deleted file mode 100644 index 3dca7376b..000000000 --- a/partner_id_number.py +++ /dev/null @@ -1,51 +0,0 @@ -############################################## -# -# ChriCar Beteiligungs- und Beratungs- GmbH -# Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH -# all rights reserved -# created 2008-07-05 -# -############################################### -import time -from openerp.osv import fields,osv -##import pooler - -class res_partner_id_category(osv.osv): - _name = "res.partner.id_category" - _columns = { - 'code' : fields.char ('Code', size=16, required=True), - 'name' : fields.char ('ID Number', size=32, required=True, translate=True), - 'active' : fields.boolean ('Active'), - } - _defaults = { - 'active': lambda *a: True, - } - _order = "name" -res_partner_id_category() - - -class res_partner_id_number(osv.osv): - _name = "res.partner.id_number" - _columns = { - 'category_id' : fields.many2one('res.partner.id_category','ID-Category', required=True), - 'name' : fields.char ('ID-Number',size=32,required=True), - 'partner_id' : fields.many2one('res.partner','Partner', required=True), - 'partner_issued_id' : fields.many2one('res.partner','Issued by', required=True), - 'date_issued' : fields.date ('Issued'), - 'valid_from' : fields.date ('Valid From'), - 'valid_until' : fields.date ('Valid Until'), - 'comment' : fields.text ('Notes'), - 'active' : fields.boolean ('Active'), - 'state' : fields.char ('State', size=16), - } - _defaults = { - 'active': lambda *a: True, - } -res_partner_id_number() - -class res_partner(osv.osv): - _inherit = "res.partner" - _columns = { - 'id_numbers': fields.one2many('res.partner.id_number','partner_id','Identification Numbers'), - } -res_partner() diff --git a/partner_id_number_demo.xml b/partner_id_number_demo.xml deleted file mode 100644 index 66eb75baa..000000000 --- a/partner_id_number_demo.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/partner_id_number_view.xml b/partner_id_number_view.xml deleted file mode 100644 index add2068b1..000000000 --- a/partner_id_number_view.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - res.partner.id_category.form - res.partner.id_category - form - -
- - - - -
- - res.partner.id_category.tree - res.partner.id_category - tree - - - - - - - - - Partner ID Categories - res.partner.id_category - form - tree,form - - - - - res.partner.form.id_number - res.partner - - - - - - - - - - - - res.partner.id_number.form - res.partner.id_number - form - -
- - - - - - - - - - -
- - res.partner.id_number.tree - res.partner.id_number - tree - - - - - - - - - - - - - Partner ID Numbers - res.partner.id_number - form - tree,form - -
-
diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index 80b8f4631..7e69931ea 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -1,5 +1,5 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_res_partner_id_number_group_user","res.partner.id_number","model_res_partner_id_number","base.group_user",1,0,0,0 "access_res_partner_id_number_group_partner_manager","res.partner.id_number","model_res_partner_id_number","base.group_partner_manager",1,1,1,1 -"access_res_partner_id_number_group_user","res.partner.id_category","model_res_partner_id_category","base.group_user",1,0,0,0 +"access_res_partner_id_category_group_user","res.partner.id_category","model_res_partner_id_category","base.group_user",1,0,0,0 "access_res_partner_id_category_group_partner_manager","res.partner.id_category","model_res_partner_id_category","base.group_partner_manager",1,1,1,1 diff --git a/security/ir.model.csv b/security/ir.model.csv deleted file mode 100644 index 35b88a8e1..000000000 --- a/security/ir.model.csv +++ /dev/null @@ -1,5 +0,0 @@ -^"id"^,^"name"^,^"model_id:id"^,^"group_id:id"^,^"perm_read"^,^"perm_write"^,^"perm_create"^,^"perm_unlink" ^ -^"access_res_partner_id_number_group_user"^,^"res.partner.id_number"^,^"model_res_partner_id_number"^,^"base.group_user"^,1,0,0,0 -^"access_res_partner_id_number_group_partner_manager"^,^"res.partner.id_number"^,^"model_res_partner_id_number"^,^"base.group_partner_manager"^,1,1,1,1 -^"access_res_partner_id_number_group_user"^,^"res.partner.id_category"^,^"model_res_partner_id_category"^,^"base.group_user"^,1,0,0,0 -^"access_res_partner_id_category_group_partner_manager"^,^"res.partner.id_category"^,^"model_res_partner_id_category"^,^"base.group_partner_manager"^,1,1,1,1 diff --git a/views/res_partner_id_category_view.xml b/views/res_partner_id_category_view.xml new file mode 100644 index 000000000..3dc79628e --- /dev/null +++ b/views/res_partner_id_category_view.xml @@ -0,0 +1,42 @@ + + + + + + + res.partner.id_category.form + res.partner.id_category + form + +
+ + + + +
+ + + res.partner.id_category.tree + res.partner.id_category + tree + + + + + + + + + + Partner ID Categories + res.partner.id_category + form + tree,form + + + + +
+
diff --git a/views/res_partner_id_number_view.xml b/views/res_partner_id_number_view.xml new file mode 100644 index 000000000..d3d0996ed --- /dev/null +++ b/views/res_partner_id_number_view.xml @@ -0,0 +1,49 @@ + + + + + + res.partner.id_number.form + res.partner.id_number + form + +
+ + + + + + + + + + + + +
+ + + res.partner.id_number.tree + res.partner.id_number + tree + + + + + + + + + + + + + + Partner ID Numbers + res.partner.id_number + form + tree,form + + +
+
diff --git a/views/res_partner_view.xml b/views/res_partner_view.xml new file mode 100644 index 000000000..a1188af9b --- /dev/null +++ b/views/res_partner_view.xml @@ -0,0 +1,23 @@ + + + + + + + res.partner.form.id_number + res.partner + + + + + + + + + + + + + +