Browse Source

[MIG] Migrate partner_firstname to v10

pull/487/head
Sylvain GARANCHER 8 years ago
committed by Enric Tobella
parent
commit
1dd40e9b39
  1. 7
      partner_firstname/__manifest__.py
  2. 4
      partner_firstname/models/res_partner.py
  3. 2
      partner_firstname/models/res_user.py
  4. 2
      partner_firstname/tests/base.py
  5. 2
      partner_firstname/tests/test_create.py
  6. 2
      partner_firstname/tests/test_defaults.py
  7. 2
      partner_firstname/tests/test_delete.py
  8. 2
      partner_firstname/tests/test_empty.py
  9. 2
      partner_firstname/tests/test_user_onchange.py
  10. 8
      partner_firstname/views/res_partner.xml
  11. 8
      partner_firstname/views/res_user.xml

7
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': '9.0.1.0.0',
'version': '10.0.1.0.0',
'author': "Camptocamp, "
"Grupo ESOC Ingeniería de Servicios, "
"Odoo Community Association (OCA)",
@ -22,9 +22,6 @@
'views/res_user.xml',
'data/res_partner.yml',
],
'demo': [],
'test': [],
'auto_install': False,
'installable': False,
'images': []
'installable': True,
}

4
partner_firstname/models/res_partner.py

@ -4,7 +4,7 @@
# © 2015 Grupo ESOC (<http://www.grupoesoc.es>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from openerp import api, fields, models
from odoo import api, fields, models
from .. import exceptions
@ -150,7 +150,6 @@ class ResPartner(models.Model):
not (self.firstname or self.lastname)):
raise exceptions.EmptyNamesError(self)
@api.one
@api.onchange("firstname", "lastname")
def _onchange_subnames(self):
"""Avoid recursion when the user changes one of these fields.
@ -162,7 +161,6 @@ class ResPartner(models.Model):
# See https://github.com/odoo/odoo/issues/7472#issuecomment-119503916.
self.env.context = self.with_context(skip_onchange=True).env.context
@api.one
@api.onchange("name")
def _onchange_name(self):
"""Ensure :attr:`~.name` is inverted in the UI."""

2
partner_firstname/models/res_user.py

@ -4,7 +4,7 @@
# © 2015 Grupo ESOC (<http://www.grupoesoc.es>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from openerp import api, models
from odoo import api, models
_logger = logging.getLogger(__name__)

2
partner_firstname/tests/base.py

@ -2,7 +2,7 @@
# © 2014 Nemry Jonathan (Acsone SA/NV) (http://www.acsone.eu)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
from .. import exceptions as ex

2
partner_firstname/tests/test_create.py

@ -4,7 +4,7 @@
"""Test default values for models."""
from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
from .base import MailInstalled

2
partner_firstname/tests/test_defaults.py

@ -4,7 +4,7 @@
"""Test default values for models."""
from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
from .base import MailInstalled

2
partner_firstname/tests/test_delete.py

@ -2,7 +2,7 @@
# © 2015 Grupo ESOC
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
from .base import MailInstalled

2
partner_firstname/tests/test_empty.py

@ -6,7 +6,7 @@
To have more accurate results, remove the ``mail`` module before testing.
"""
from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
from .base import MailInstalled
from .. import exceptions as ex

2
partner_firstname/tests/test_user_onchange.py

@ -2,7 +2,7 @@
# © 2016 Yannick Vaucher (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
class UserOnchangeCase(TransactionCase):

8
partner_firstname/views/res_partner.xml

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<record id="view_partner_simple_form_firstname" model="ir.ui.view">
<field name="name">Add firstname and lastname</field>
<field name="model">res.partner</field>
@ -81,6 +79,4 @@
</data>
</field>
</record>
</data>
</openerp>
</odoo>

8
partner_firstname/views/res_user.xml

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<record id="view_users_form" model="ir.ui.view">
<field name="name">Add firstname and surnames</field>
<field name="model">res.users</field>
@ -24,6 +22,4 @@
</data>
</field>
</record>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save