diff --git a/base_partner_surname/__init__.py b/base_partner_surname/__init__.py new file mode 100644 index 000000000..a8fdaa846 --- /dev/null +++ b/base_partner_surname/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## +import partner + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/base_partner_surname/__openerp__.py b/base_partner_surname/__openerp__.py new file mode 100755 index 000000000..20c194d09 --- /dev/null +++ b/base_partner_surname/__openerp__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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" : "Base Partner Surname", + "version" : "1.1", + "author" : "Tiny, Serpent Consulting Services", + "website" : "http://www.openerp.com", + "category" : "Generic Modules/Base", + "description": """ +This module is used for separate surname from contact name of partner. Now You can give first name & last name on contact Name. +This module is deprecated, it is highly recommended to use base_contact instead. + + """, + "depends" : ["base"], + "init_xml" : [ ], + "demo_xml" : [ ], + "update_xml" : [ "partner_view.xml" ], + "installable": True, + "auto_install": False +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/base_partner_surname/i18n/base_partner_surname.pot b/base_partner_surname/i18n/base_partner_surname.pot new file mode 100644 index 000000000..379813c64 --- /dev/null +++ b/base_partner_surname/i18n/base_partner_surname.pot @@ -0,0 +1,51 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_partner_surname +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.6\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-11-25 05:35:30+0000\n" +"PO-Revision-Date: 2009-11-25 05:35:30+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_partner_surname +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: base_partner_surname +#: field:res.partner.address,last_name:0 +msgid "Last Name" +msgstr "" + +#. module: base_partner_surname +#: model:ir.module.module,shortdesc:base_partner_surname.module_meta_information +msgid "Base Partner Surname" +msgstr "" + +#. module: base_partner_surname +#: field:res.partner.address,first_name:0 +msgid "First Name" +msgstr "" + +#. module: base_partner_surname +#: model:ir.module.module,description:base_partner_surname.module_meta_information +msgid "\n" +"This module use for seperate surname from contact name of partner. Now You can give first name & last name on contact Name.\n" +"This module is deprecated, it is higly recommended to use base_contact instead.\n" +"\n" +" " +msgstr "" + +#. module: base_partner_surname +#: view:res.partner:0 +msgid "Partner Contacts" +msgstr "" + diff --git a/base_partner_surname/i18n/ca.po b/base_partner_surname/i18n/ca.po new file mode 100644 index 000000000..45de68990 --- /dev/null +++ b/base_partner_surname/i18n/ca.po @@ -0,0 +1,63 @@ +# Catalan translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-11-25 05:35+0000\n" +"PO-Revision-Date: 2010-07-20 19:22+0000\n" +"Last-Translator: Jordi Esteve (www.zikzakmedia.com) " +"\n" +"Language-Team: Catalan \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-12-05 05:38+0000\n" +"X-Generator: Launchpad (build 16335)\n" + +#. module: base_partner_surname +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML no vàlid per a l'estructura de la vista!" + +#. module: base_partner_surname +#: field:res.partner.address,last_name:0 +msgid "Last Name" +msgstr "Cognoms" + +#. module: base_partner_surname +#: model:ir.module.module,shortdesc:base_partner_surname.module_meta_information +msgid "Base Partner Surname" +msgstr "Base - Cognoms a les empreses" + +#. module: base_partner_surname +#: field:res.partner.address,first_name:0 +msgid "First Name" +msgstr "Nom" + +#. module: base_partner_surname +#: model:ir.module.module,description:base_partner_surname.module_meta_information +msgid "" +"\n" +"This module use for seperate surname from contact name of partner. Now You " +"can give first name & last name on contact Name.\n" +"This module is deprecated, it is higly recommended to use base_contact " +"instead.\n" +"\n" +" " +msgstr "" +"\n" +"Aquest mòdul serveix per a separar nom i cognoms en el contacte de " +"l'empresa. Permet introduir el nom i cognoms en el nom de contacte.\n" +"Aquest mòdul està obsolet, es molt recomanable en el seu lloc utilitzar " +"base_contact.\n" +"\n" +" " + +#. module: base_partner_surname +#: view:res.partner:0 +msgid "Partner Contacts" +msgstr "Contactes de l'empresa" diff --git a/base_partner_surname/i18n/es.po b/base_partner_surname/i18n/es.po new file mode 100644 index 000000000..fb1dce7a0 --- /dev/null +++ b/base_partner_surname/i18n/es.po @@ -0,0 +1,62 @@ +# Spanish translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-11-25 05:35+0000\n" +"PO-Revision-Date: 2010-09-03 08:05+0000\n" +"Last-Translator: OpenERP Administrators \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-12-05 05:38+0000\n" +"X-Generator: Launchpad (build 16335)\n" + +#. module: base_partner_surname +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "¡XML no válido para la estructura de la vista!" + +#. module: base_partner_surname +#: field:res.partner.address,last_name:0 +msgid "Last Name" +msgstr "Apellidos" + +#. module: base_partner_surname +#: model:ir.module.module,shortdesc:base_partner_surname.module_meta_information +msgid "Base Partner Surname" +msgstr "Nombre y apellidos para contactos de empresas" + +#. module: base_partner_surname +#: field:res.partner.address,first_name:0 +msgid "First Name" +msgstr "Nombre" + +#. module: base_partner_surname +#: model:ir.module.module,description:base_partner_surname.module_meta_information +msgid "" +"\n" +"This module use for seperate surname from contact name of partner. Now You " +"can give first name & last name on contact Name.\n" +"This module is deprecated, it is higly recommended to use base_contact " +"instead.\n" +"\n" +" " +msgstr "" +"\n" +"Este módulo sirve para separar nombre y apellidos en el contacto de la " +"empresa. Permite introducir el nombre y apellidos en el nombre de contacto.\n" +"Este módulo está obsoleto, es muy recomendable en su lugar utilizar " +"base_contact.\n" +"\n" +" " + +#. module: base_partner_surname +#: view:res.partner:0 +msgid "Partner Contacts" +msgstr "Contactos de la empresa" diff --git a/base_partner_surname/i18n/fi.po b/base_partner_surname/i18n/fi.po new file mode 100644 index 000000000..754419802 --- /dev/null +++ b/base_partner_surname/i18n/fi.po @@ -0,0 +1,55 @@ +# Finnish translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-11-25 05:35+0000\n" +"PO-Revision-Date: 2011-06-28 06:54+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Finnish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-12-05 05:38+0000\n" +"X-Generator: Launchpad (build 16335)\n" + +#. module: base_partner_surname +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "Virheellinen XML näkymä-arkkitehtuurille!" + +#. module: base_partner_surname +#: field:res.partner.address,last_name:0 +msgid "Last Name" +msgstr "Sukunimi" + +#. module: base_partner_surname +#: model:ir.module.module,shortdesc:base_partner_surname.module_meta_information +msgid "Base Partner Surname" +msgstr "Kumppanin sukunimi" + +#. module: base_partner_surname +#: field:res.partner.address,first_name:0 +msgid "First Name" +msgstr "Etunimi" + +#. module: base_partner_surname +#: model:ir.module.module,description:base_partner_surname.module_meta_information +msgid "" +"\n" +"This module use for seperate surname from contact name of partner. Now You " +"can give first name & last name on contact Name.\n" +"This module is deprecated, it is higly recommended to use base_contact " +"instead.\n" +"\n" +" " +msgstr "" + +#. module: base_partner_surname +#: view:res.partner:0 +msgid "Partner Contacts" +msgstr "Partnerin yhteystiedot" diff --git a/base_partner_surname/i18n/fr.po b/base_partner_surname/i18n/fr.po new file mode 100644 index 000000000..63dd97c58 --- /dev/null +++ b/base_partner_surname/i18n/fr.po @@ -0,0 +1,55 @@ +# French translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-11-25 05:35+0000\n" +"PO-Revision-Date: 2010-06-04 07:10+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-12-05 05:38+0000\n" +"X-Generator: Launchpad (build 16335)\n" + +#. module: base_partner_surname +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML non valide pour l'architecture de la vue" + +#. module: base_partner_surname +#: field:res.partner.address,last_name:0 +msgid "Last Name" +msgstr "Nom" + +#. module: base_partner_surname +#: model:ir.module.module,shortdesc:base_partner_surname.module_meta_information +msgid "Base Partner Surname" +msgstr "" + +#. module: base_partner_surname +#: field:res.partner.address,first_name:0 +msgid "First Name" +msgstr "Prénom" + +#. module: base_partner_surname +#: model:ir.module.module,description:base_partner_surname.module_meta_information +msgid "" +"\n" +"This module use for seperate surname from contact name of partner. Now You " +"can give first name & last name on contact Name.\n" +"This module is deprecated, it is higly recommended to use base_contact " +"instead.\n" +"\n" +" " +msgstr "" + +#. module: base_partner_surname +#: view:res.partner:0 +msgid "Partner Contacts" +msgstr "Contacts du partenaire" diff --git a/base_partner_surname/i18n/fr_BE.po b/base_partner_surname/i18n/fr_BE.po new file mode 100644 index 000000000..379813c64 --- /dev/null +++ b/base_partner_surname/i18n/fr_BE.po @@ -0,0 +1,51 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_partner_surname +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.6\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-11-25 05:35:30+0000\n" +"PO-Revision-Date: 2009-11-25 05:35:30+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_partner_surname +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: base_partner_surname +#: field:res.partner.address,last_name:0 +msgid "Last Name" +msgstr "" + +#. module: base_partner_surname +#: model:ir.module.module,shortdesc:base_partner_surname.module_meta_information +msgid "Base Partner Surname" +msgstr "" + +#. module: base_partner_surname +#: field:res.partner.address,first_name:0 +msgid "First Name" +msgstr "" + +#. module: base_partner_surname +#: model:ir.module.module,description:base_partner_surname.module_meta_information +msgid "\n" +"This module use for seperate surname from contact name of partner. Now You can give first name & last name on contact Name.\n" +"This module is deprecated, it is higly recommended to use base_contact instead.\n" +"\n" +" " +msgstr "" + +#. module: base_partner_surname +#: view:res.partner:0 +msgid "Partner Contacts" +msgstr "" + diff --git a/base_partner_surname/i18n/it.po b/base_partner_surname/i18n/it.po new file mode 100644 index 000000000..4cceda3f2 --- /dev/null +++ b/base_partner_surname/i18n/it.po @@ -0,0 +1,62 @@ +# Italian translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-11-25 05:35+0000\n" +"PO-Revision-Date: 2010-08-18 12:13+0000\n" +"Last-Translator: OpenERP Administrators \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-12-05 05:38+0000\n" +"X-Generator: Launchpad (build 16335)\n" + +#. module: base_partner_surname +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML non valido per visualizzare l'Achitettura!" + +#. module: base_partner_surname +#: field:res.partner.address,last_name:0 +msgid "Last Name" +msgstr "Cognome" + +#. module: base_partner_surname +#: model:ir.module.module,shortdesc:base_partner_surname.module_meta_information +msgid "Base Partner Surname" +msgstr "Cognome Partner di base" + +#. module: base_partner_surname +#: field:res.partner.address,first_name:0 +msgid "First Name" +msgstr "Nome" + +#. module: base_partner_surname +#: model:ir.module.module,description:base_partner_surname.module_meta_information +msgid "" +"\n" +"This module use for seperate surname from contact name of partner. Now You " +"can give first name & last name on contact Name.\n" +"This module is deprecated, it is higly recommended to use base_contact " +"instead.\n" +"\n" +" " +msgstr "" +"\n" +"Questo modulo si usa per separare il cognome dal nome contatto del partner. " +"Ora puoi dare Nome & Cognome a Nome Contatto.\n" +"Questo modulo è obsoleto, è altamente raccomandato l'utilizzo del modulo: " +"base_contact al suo posto.\n" +"\n" +" " + +#. module: base_partner_surname +#: view:res.partner:0 +msgid "Partner Contacts" +msgstr "Contatti del partner" diff --git a/base_partner_surname/i18n/pt.po b/base_partner_surname/i18n/pt.po new file mode 100644 index 000000000..09cd5b3fb --- /dev/null +++ b/base_partner_surname/i18n/pt.po @@ -0,0 +1,62 @@ +# Portuguese translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-11-25 05:35+0000\n" +"PO-Revision-Date: 2010-11-30 14:52+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-12-05 05:38+0000\n" +"X-Generator: Launchpad (build 16335)\n" + +#. module: base_partner_surname +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML Inválido para a Arquitectura de Vista!" + +#. module: base_partner_surname +#: field:res.partner.address,last_name:0 +msgid "Last Name" +msgstr "Ùltimo Nome" + +#. module: base_partner_surname +#: model:ir.module.module,shortdesc:base_partner_surname.module_meta_information +msgid "Base Partner Surname" +msgstr "Apelido de Terceiro Base" + +#. module: base_partner_surname +#: field:res.partner.address,first_name:0 +msgid "First Name" +msgstr "Primeiro Nome" + +#. module: base_partner_surname +#: model:ir.module.module,description:base_partner_surname.module_meta_information +msgid "" +"\n" +"This module use for seperate surname from contact name of partner. Now You " +"can give first name & last name on contact Name.\n" +"This module is deprecated, it is higly recommended to use base_contact " +"instead.\n" +"\n" +" " +msgstr "" +"\n" +"Este módulo serve para separar nome e apelido do contacto do terceiro. " +"Permite introduzir o primeiro nome e o último nome de contacto.\n" +"Este módulo é obsoleto, é altamente recomendado que utilize base_contact " +"como alternativa .\n" +"\n" +" " + +#. module: base_partner_surname +#: view:res.partner:0 +msgid "Partner Contacts" +msgstr "Contactos de Terceiros" diff --git a/base_partner_surname/i18n/sv.po b/base_partner_surname/i18n/sv.po new file mode 100644 index 000000000..b9197da25 --- /dev/null +++ b/base_partner_surname/i18n/sv.po @@ -0,0 +1,54 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_partner_surname +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.14\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-11-25 05:35+0000\n" +"PO-Revision-Date: 2010-11-22 21:29+0000\n" +"Last-Translator: Olivier Dony (OpenERP) \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-12-05 05:38+0000\n" +"X-Generator: Launchpad (build 16335)\n" + +#. module: base_partner_surname +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: base_partner_surname +#: field:res.partner.address,last_name:0 +msgid "Last Name" +msgstr "" + +#. module: base_partner_surname +#: model:ir.module.module,shortdesc:base_partner_surname.module_meta_information +msgid "Base Partner Surname" +msgstr "Base Partner Surname" + +#. module: base_partner_surname +#: field:res.partner.address,first_name:0 +msgid "First Name" +msgstr "" + +#. module: base_partner_surname +#: model:ir.module.module,description:base_partner_surname.module_meta_information +msgid "" +"\n" +"This module use for seperate surname from contact name of partner. Now You " +"can give first name & last name on contact Name.\n" +"This module is deprecated, it is higly recommended to use base_contact " +"instead.\n" +"\n" +" " +msgstr "" + +#. module: base_partner_surname +#: view:res.partner:0 +msgid "Partner Contacts" +msgstr "" diff --git a/base_partner_surname/partner.py b/base_partner_surname/partner.py new file mode 100644 index 000000000..f63f22fa6 --- /dev/null +++ b/base_partner_surname/partner.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 + + +class res_partner_address(orm.Model): + _inherit = 'res.partner.address' + _columns = { + 'first_name' : fields.char('First Name', size=128), + 'last_name' : fields.char('Last Name', size=128), + 'name' : fields.char('Name', size=128, readonly=True), + } + + def write(self, cr, uid, ids, vals, context=None): + if context is None: + context = {} + if isinstance(ids,list): + ids = ids[0] + data = self.read(cr, uid, ids, ['first_name','last_name'], context=context) + first_name = data['first_name'] or '' + if 'first_name' in vals: + first_name = vals['first_name'] or '' + + last_name = data['last_name'] or '' + if 'last_name' in vals: + last_name = vals['last_name'] or '' + + if first_name or last_name: + vals['name'] = first_name + ' ' + last_name + return super(res_partner_address, self).write(cr, uid, ids, vals, context=context) + + def create(self, cr, uid, vals, context=None): + if context is None: + context = {} + first_name = '' + last_name = '' + if 'first_name' in vals: + first_name = vals['first_name'] or '' + if 'last_name' in vals: + last_name = vals['last_name'] or '' + + if first_name or last_name: + vals['name'] = first_name + ' ' + last_name + return super(res_partner_address, self).create(cr, uid, vals, context=context) + + def onchange_name(self, cr, uid, id, first_name, last_name): + res = {} + if not first_name: + first_name = '' + if not last_name: + last_name = '' + if first_name or last_name: + res = {'name': first_name + ' ' + last_name} + return {'value': res} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/base_partner_surname/partner_view.xml b/base_partner_surname/partner_view.xml new file mode 100644 index 000000000..799d64407 --- /dev/null +++ b/base_partner_surname/partner_view.xml @@ -0,0 +1,32 @@ + + + + + res.partner.address.form1.inherit + res.partner.address + form + + + + + + + + + + + + res.partner.form.inherit + res.partner + form + + + + + + + + + + +