Browse Source
[IMP] partner_firstname: Only run install function on update
* Remove yml data file for install and move method to init hook
* Bump version
pull/460/head
Dave Lasley
7 years ago
No known key found for this signature in database
GPG Key ID: 7DDBA4BA81B934CF
4 changed files with
15 additions and
21 deletions
-
partner_firstname/__init__.py
-
partner_firstname/__manifest__.py
-
partner_firstname/data/res_partner.yml
-
partner_firstname/hooks.py
|
|
@ -1,4 +1,6 @@ |
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
# © 2013 Nicolas Bessi (Camptocamp SA) |
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
|
|
|
|
|
from . import models |
|
|
|
from .hooks import post_init_hook |
|
|
@ -7,7 +7,7 @@ |
|
|
|
{ |
|
|
|
'name': 'Partner first name and last name', |
|
|
|
'summary': "Split first name and last name for non company partners", |
|
|
|
'version': '10.0.2.0.0', |
|
|
|
'version': '10.0.2.1.0', |
|
|
|
'author': "Camptocamp, " |
|
|
|
"Grupo ESOC Ingeniería de Servicios, " |
|
|
|
"Tecnativa, " |
|
|
@ -19,11 +19,11 @@ |
|
|
|
'category': 'Extra Tools', |
|
|
|
'website': 'https://odoo-community.org/', |
|
|
|
'depends': ['base_setup'], |
|
|
|
'post_init_hook': 'post_init_hook', |
|
|
|
'data': [ |
|
|
|
'views/base_config_view.xml', |
|
|
|
'views/res_partner.xml', |
|
|
|
'views/res_user.xml', |
|
|
|
'data/res_partner.yml', |
|
|
|
], |
|
|
|
'auto_install': False, |
|
|
|
'installable': True, |
|
|
|
|
|
@ -1,19 +0,0 @@ |
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
|
|
|
|
# Copyright (C) |
|
|
|
# 2015: Grupo ESOC <www.grupoesoc.es> |
|
|
|
# |
|
|
|
# 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/>. |
|
|
|
|
|
|
|
- !function {model: res.partner, name: _install_partner_firstname} |
|
|
@ -0,0 +1,11 @@ |
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
# Copyright 2017 LasLabs Inc. |
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
|
|
|
|
|
from odoo import api, SUPERUSER_ID |
|
|
|
|
|
|
|
|
|
|
|
def post_init_hook(cr, _): |
|
|
|
with api.Environment.manage(): |
|
|
|
env = api.Environment(cr, SUPERUSER_ID, {}) |
|
|
|
env['res.partner']._install_partner_firstname() |