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/487/head
Dave Lasley 7 years ago
committed by Enric Tobella
parent
commit
d7d2868a94
  1. 2
      partner_firstname/__init__.py
  2. 4
      partner_firstname/__manifest__.py
  3. 19
      partner_firstname/data/res_partner.yml
  4. 11
      partner_firstname/hooks.py

2
partner_firstname/__init__.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

4
partner_firstname/__manifest__.py

@ -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,

19
partner_firstname/data/res_partner.yml

@ -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}

11
partner_firstname/hooks.py

@ -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()
Loading…
Cancel
Save