Browse Source

[MIG] partner_firstname: Style improvements for forward port

* Prefer odoo to openerp & remove data tags
* Move exceptions file out of models
pull/333/head
Dave Lasley 8 years ago
committed by Pedro M. Baeza
parent
commit
0b1d1a1444
  1. 6
      partner_firstname/README.rst
  2. 1
      partner_firstname/__openerp__.py
  3. 0
      partner_firstname/exceptions.py
  4. 1
      partner_firstname/models/__init__.py
  5. 6
      partner_firstname/models/base_config_settings.py
  6. 0
      partner_firstname/models/res_users.py
  7. 2
      partner_firstname/tests/base.py
  8. 2
      partner_firstname/tests/test_empty.py
  9. 11
      partner_firstname/views/base_config_view.xml
  10. 6
      partner_firstname/views/res_partner.xml
  11. 6
      partner_firstname/views/res_user.xml

6
partner_firstname/README.rst

@ -47,7 +47,7 @@ supply the *last name* and *first name* (just once per contact).
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/134/8.0
:target: https://runbot.odoo-community.org/runbot/134/9.0
For further information, please visit: For further information, please visit:
@ -68,8 +68,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues Bugs are tracked on `GitHub Issues
<https://github.com/OCA/partner-contact/issues>`_. In case of trouble, please <https://github.com/OCA/partner-contact/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first, check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback `here
<https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_firstname%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
help us smashing it by providing a detailed and welcomed feedback.
Credits Credits
======= =======
@ -93,6 +92,7 @@ Contributors
* Ronald Portier <ronald@therp.nl> * Ronald Portier <ronald@therp.nl>
* Sylvain Van Hoof * Sylvain Van Hoof
* Pedro Baeza <pedro.baeza@serviciosbaeza.com> * Pedro Baeza <pedro.baeza@serviciosbaeza.com>
* Dave Lasley <dave@laslabs.com>
Translations Translations
------------ ------------

1
partner_firstname/__openerp__.py

@ -10,6 +10,7 @@
'version': '9.0.2.0.0', 'version': '9.0.2.0.0',
'author': "Camptocamp, " 'author': "Camptocamp, "
"Grupo ESOC Ingeniería de Servicios, " "Grupo ESOC Ingeniería de Servicios, "
"Tecnativa, "
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
'license': "AGPL-3", 'license': "AGPL-3",
'maintainer': 'Camptocamp, Acsone', 'maintainer': 'Camptocamp, Acsone',

0
partner_firstname/models/exceptions.py → partner_firstname/exceptions.py

1
partner_firstname/models/__init__.py

@ -4,3 +4,4 @@
from . import base_config_settings from . import base_config_settings
from . import res_partner from . import res_partner
from . import res_users

6
partner_firstname/models/base_config_settings.py

@ -36,10 +36,14 @@ class BaseConfigSettings(models.TransientModel):
} }
@api.multi @api.multi
@api.depends('partner_names_order')
def _compute_names_order_changed(self): def _compute_names_order_changed(self):
current = self.env['ir.config_parameter'].get_param( current = self.env['ir.config_parameter'].get_param(
'partner_names_order', self._partner_names_order_default()) 'partner_names_order', self._partner_names_order_default())
return self.partner_names_order != current
for record in self:
record.partner_names_order_changed = bool(
record.partner_names_order != current
)
@api.onchange('partner_names_order') @api.onchange('partner_names_order')
def _onchange_partner_names_order(self): def _onchange_partner_names_order(self):

0
partner_firstname/models/res_user.py → partner_firstname/models/res_users.py

2
partner_firstname/tests/base.py

@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase from openerp.tests.common import TransactionCase
from ..models import exceptions as ex
from .. import exceptions as ex
class MailInstalled(): class MailInstalled():

2
partner_firstname/tests/test_empty.py

@ -8,7 +8,7 @@ To have more accurate results, remove the ``mail`` module before testing.
""" """
from openerp.tests.common import TransactionCase from openerp.tests.common import TransactionCase
from .base import MailInstalled from .base import MailInstalled
from ..models import exceptions as ex
from .. import exceptions as ex
class CompanyCase(TransactionCase): class CompanyCase(TransactionCase):

11
partner_firstname/views/base_config_view.xml

@ -1,15 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Antiun Ingenieria S.L. - Antonio Espinosa <!-- © 2015 Antiun Ingenieria S.L. - Antonio Espinosa
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<openerp>
<data>
<odoo>
<record id="view_general_configuration" model="ir.ui.view"> <record id="view_general_configuration" model="ir.ui.view">
<field name="name">Add partner_names_order config parameter</field> <field name="name">Add partner_names_order config parameter</field>
<field name="model">base.config.settings</field> <field name="model">base.config.settings</field>
<field name="inherit_id" ref="base_setup.view_general_configuration"/> <field name="inherit_id" ref="base_setup.view_general_configuration"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//label[@string='Email']/.." position='after'>
<xpath expr="//label[@name='email_label']/.." position='after'>
<group> <group>
<label for="partner_names_order" /> <label for="partner_names_order" />
<div> <div>
@ -18,7 +17,7 @@
<field name="partner_names_order_changed" invisible="1"/> <field name="partner_names_order_changed" invisible="1"/>
<button name="action_recalculate_partners_name" <button name="action_recalculate_partners_name"
string="Recalculate names" string="Recalculate names"
icon="gtk-execute"
icon="fa-play"
type="object" type="object"
help="Recalculate names for all partners. This process could take so much time if there are more than 10,000 active partners" help="Recalculate names for all partners. This process could take so much time if there are more than 10,000 active partners"
attrs="{'invisible': [('partner_names_order_changed', '=', True)]}"/> attrs="{'invisible': [('partner_names_order_changed', '=', True)]}"/>
@ -29,6 +28,4 @@
</field> </field>
</record> </record>
</data>
</openerp>
</odoo>

6
partner_firstname/views/res_partner.xml

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

6
partner_firstname/views/res_user.xml

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