Browse Source
[FIX] Combined passport and passport_partner into passport, removed redundant view changes, general cleanup
pull/2/head
[FIX] Combined passport and passport_partner into passport, removed redundant view changes, general cleanup
pull/2/head
Sandy Carter
11 years ago
14 changed files with 130 additions and 429 deletions
-
5passport/__init__.py
-
12passport/__openerp__.py
-
60passport/i18n/fr.po
-
51passport/i18n/passport.pot
-
16passport/res_partner.py
-
17passport/res_partner_view.xml
-
46passport/res_passport.py
-
6passport/res_passport_view.xml
-
24passport_partner/__init__.py
-
57passport_partner/__openerp__.py
-
76passport_partner/i18n/fr.po
-
76passport_partner/i18n/passport_partner.pot
-
60passport_partner/res_partner.py
-
49passport_partner/res_partner_view.xml
@ -0,0 +1,17 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<record id="view_partner_form" model="ir.ui.view"> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<notebook position="inside"> |
|||
<page string="Passport" attrs="{'invisible': [('is_company','=',True)]}"> |
|||
<field name="passport_ids" nolabel="1"/> |
|||
</page> |
|||
</notebook> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</openerp> |
@ -1,24 +0,0 @@ |
|||
# -*- encoding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# This module copyright (C) 2013 Savoir-faire Linux |
|||
# (<http://www.savoirfairelinux.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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
|
|||
from . import res_passport |
|||
from . import res_partner |
@ -1,57 +0,0 @@ |
|||
# -*- encoding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# This module copyright (C) 2013 Savoir-faire Linux |
|||
# (<http://www.savoirfairelinux.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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
|
|||
{ |
|||
'name': 'Passport Management - Partners Bindings', |
|||
'version': '0.1', |
|||
'author': 'Savoir-faire Linux', |
|||
'maintainer': 'Savoir-faire Linux', |
|||
'website': 'http://www.savoirfairelinux.com', |
|||
'license': 'AGPL-3', |
|||
'category': 'Customer Relationship Management', |
|||
'summary': 'Partner Multi Passport', |
|||
'description': """ |
|||
Passport Management - Partners Bindings |
|||
======================================= |
|||
|
|||
This module allows you to manage several passports for each contact. |
|||
|
|||
Contributors |
|||
------------ |
|||
* El Hadji Dem (elhadji.dem@savoirfairelinux.com) |
|||
|
|||
""", |
|||
'depends': [ |
|||
'passport' |
|||
], |
|||
'external_dependencies': { |
|||
'python': [], |
|||
}, |
|||
'data': [ |
|||
"res_partner_view.xml", |
|||
], |
|||
'demo': [], |
|||
'test': [], |
|||
'installable': True, |
|||
} |
|||
|
|||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
@ -1,76 +0,0 @@ |
|||
# Translation of OpenERP Server. |
|||
# This file contains the translation of the following modules: |
|||
# * passport_partner |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: OpenERP Server 7.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2014-02-05 22:07+0000\n" |
|||
"PO-Revision-Date: 2014-02-05 17:09-0500\n" |
|||
"Last-Translator: EL Hadji DEM <elhadji.dem@savoirfairelinux.com>\n" |
|||
"Language-Team: \n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: 8bit\n" |
|||
"Plural-Forms: \n" |
|||
"X-Generator: Poedit 1.5.4\n" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.partner:0 |
|||
msgid "Create" |
|||
msgstr "Créer" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.partner:0 |
|||
msgid "Passport Details" |
|||
msgstr "Détails du passeport" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.passport:0 |
|||
msgid "or" |
|||
msgstr "ou" |
|||
|
|||
#. module: passport_partner |
|||
#: code:addons/passport_partner/res_partner.py:37 |
|||
#: code:addons/passport_partner/res_partner.py:38 |
|||
#, python-format |
|||
msgid "New Passport" |
|||
msgstr "Nouveau passeport" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.passport:0 |
|||
msgid "Save and Close" |
|||
msgstr "Enregistrer et fermer" |
|||
|
|||
#. module: passport_partner |
|||
#: field:res.passport,partner_id:0 |
|||
msgid "Contact" |
|||
msgstr "Contact" |
|||
|
|||
#. module: passport_partner |
|||
#: model:ir.actions.act_window,name:passport_partner.action_passport_list |
|||
#: model:ir.model,name:passport_partner.model_res_passport view:res.partner:0 |
|||
#: field:res.partner,passport_ids:0 view:res.passport:0 |
|||
msgid "Passport" |
|||
msgstr "Passeport" |
|||
|
|||
#. module: passport_partner |
|||
#: model:ir.model,name:passport_partner.model_res_partner |
|||
msgid "Partner" |
|||
msgstr "Organisme" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.passport:0 |
|||
msgid "Discard" |
|||
msgstr "Annuler" |
|||
|
|||
#. module: passport_partner |
|||
#: help:res.passport,partner_id:0 |
|||
msgid "Contact." |
|||
msgstr "Contact." |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.partner:0 view:res.passport:0 |
|||
msgid "Owner name (As printed into the passport)" |
|||
msgstr "Nom du propriétaire (Comme écrit sur le passeport)" |
@ -1,76 +0,0 @@ |
|||
# Translation of OpenERP Server. |
|||
# This file contains the translation of the following modules: |
|||
# * passport_partner |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: OpenERP Server 7.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2014-02-05 22:05+0000\n" |
|||
"PO-Revision-Date: 2014-02-05 17:06-0500\n" |
|||
"Last-Translator: EL Hadji DEM <elhadji.dem@savoirfairelinux.com>\n" |
|||
"Language-Team: \n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: 8bit\n" |
|||
"Plural-Forms: \n" |
|||
"X-Generator: Poedit 1.5.4\n" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.partner:0 |
|||
msgid "Create" |
|||
msgstr "" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.partner:0 |
|||
msgid "Passport Details" |
|||
msgstr "" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.passport:0 |
|||
msgid "or" |
|||
msgstr "" |
|||
|
|||
#. module: passport_partner |
|||
#: code:addons/passport_partner/res_partner.py:37 |
|||
#: code:addons/passport_partner/res_partner.py:38 |
|||
#, python-format |
|||
msgid "New Passport" |
|||
msgstr "" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.passport:0 |
|||
msgid "Save and Close" |
|||
msgstr "" |
|||
|
|||
#. module: passport_partner |
|||
#: field:res.passport,partner_id:0 |
|||
msgid "Contact" |
|||
msgstr "" |
|||
|
|||
#. module: passport_partner |
|||
#: model:ir.actions.act_window,name:passport_partner.action_passport_list |
|||
#: model:ir.model,name:passport_partner.model_res_passport view:res.partner:0 |
|||
#: field:res.partner,passport_ids:0 view:res.passport:0 |
|||
msgid "Passport" |
|||
msgstr "" |
|||
|
|||
#. module: passport_partner |
|||
#: model:ir.model,name:passport_partner.model_res_partner |
|||
msgid "Partner" |
|||
msgstr "" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.passport:0 |
|||
msgid "Discard" |
|||
msgstr "" |
|||
|
|||
#. module: passport_partner |
|||
#: help:res.passport,partner_id:0 |
|||
msgid "Contact." |
|||
msgstr "" |
|||
|
|||
#. module: passport_partner |
|||
#: view:res.partner:0 view:res.passport:0 |
|||
msgid "Owner name (As printed into the passport)" |
|||
msgstr "" |
@ -1,60 +0,0 @@ |
|||
# -*- encoding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# This module copyright (C) 2013 Savoir-faire Linux |
|||
# (<http://www.savoirfairelinux.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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from openerp.osv import orm, fields |
|||
from openerp.tools.translate import _ |
|||
|
|||
|
|||
class res_partner(orm.Model): |
|||
_inherit = 'res.partner' |
|||
_columns = { |
|||
'passport_ids': fields.one2many('res.passport', 'partner_id', 'Passport'), |
|||
} |
|||
|
|||
def action_add_passport_form_view(self, cr, uid, ids, context=None): |
|||
"""Call action, if there is a contact, put it in the name.""" |
|||
ir_model_data = self.pool.get('ir.model.data') |
|||
contacts = self.browse(cr, uid, ids, context=context) |
|||
contact_name = ('%s : %s ' % (contacts[0].full_name, _('New Passport')) if len(contacts) == 1 else False) |
|||
name = contact_name or _('New Passport') |
|||
try: |
|||
compose_form_id = ir_model_data.get_object_reference(cr, uid, 'passport_partner', 'add_passport_form_view')[1] |
|||
except ValueError: |
|||
compose_form_id = False |
|||
ctx = dict(context) |
|||
ctx.update({ |
|||
'default_res_id': ids[0], |
|||
'default_partner_id': ids[0], |
|||
}) |
|||
return { |
|||
'name': name, |
|||
'type': 'ir.actions.act_window', |
|||
'view_type': 'form', |
|||
'view_mode': 'form', |
|||
'res_model': 'res.passport', |
|||
'views': [(compose_form_id, 'form')], |
|||
'view_id': compose_form_id, |
|||
'target': 'new', |
|||
'context': ctx, |
|||
} |
|||
|
|||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
@ -1,49 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<record id="view_passport_partner_form" model="ir.ui.view"> |
|||
<field name="name">passport.partner.form.inherit</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<notebook position="inside"> |
|||
<page string="Passport" attrs="{'invisible': ['|','|',('is_company','=',True),('contact_id','!=',False)]}"> |
|||
<button string="Create" name="action_add_passport_form_view" type="object" class="oe_highlight"/> |
|||
<field name="passport_ids" nolabel="1"> |
|||
<tree string="Passport Details" create="false" version="7.0"> |
|||
<field name="country_id"/> |
|||
<field name="number"/> |
|||
<field name="expiration_date"/> |
|||
<field name="name"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</notebook> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- Form Views passport-contact--> |
|||
<record model="ir.ui.view" id="add_passport_form_view"> |
|||
<field name="name">Passport Form View</field> |
|||
<field name="model">res.passport</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Passport" version="7.0"> |
|||
<group col="4"> |
|||
<field name="country_id"/> |
|||
<field name="name" string="Owner name (As printed into the passport)"/> |
|||
<field name="number"/> |
|||
<field name="gender"/> |
|||
<field name="expiration_date"/> |
|||
<field name="birth_date"/> |
|||
<field name="partner_id" invisible="1"/> |
|||
</group> |
|||
<footer attrs="{'invisible': [('partner_id','=',False)]}"> |
|||
<button string="Save and Close" name="_" type="action" class="oe_highlight" accesskey="C"/> |
|||
or |
|||
<button string="Discard" class="oe_link" special="cancel" accesskey="D"/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue