Browse Source

[IMP][partner_firstname] Update documentation according methods refactoring

pull/663/head
Adrien Peiffer (ACSONE) 9 years ago
committed by Jairo Llopis
parent
commit
b6185e0aa1
  1. 5
      partner_firstname/README.rst
  2. 6
      partner_firstname/models.py

5
partner_firstname/README.rst

@ -24,6 +24,10 @@ For the same reason, after installing, previous names for contacts will stay in
the *name* field, and the first time you edit any of them you will be asked to
supply the *last name* and *first name* (just once per contact).
You can use *_get_inverse_name* method to get lastname and firstname from a simple string
and also *_get_computed_name* to get a name form the lastname and firstname.
These methods can be overridden to change the format specified above
For further information, please visit:
* https://www.odoo.com/forum/help-1
@ -39,6 +43,7 @@ Contributors
* Olivier Laurent <olivier.laurent@acsone.eu>
* Hans Henrik Gabelgaard <hhg@gabelgaard.org>
* Jairo Llopis <j.llopis@grupoesoc.es>
* Adrien Peiffer <adrien.peiffer@acsone.eu>
Maintainer
----------

6
partner_firstname/models.py

@ -40,7 +40,9 @@ class ResPartner(models.Model):
@api.model
def _get_computed_name(self, lastname, firstname):
"""Write the 'name' field according to splitted data."""
"""Compute the 'name' field according to splitted data.
You can override this method to change the order of lastname and
firstname the computed name"""
return u" ".join((p for p in (lastname, firstname) if p))
@api.one
@ -77,6 +79,8 @@ class ResPartner(models.Model):
- Otherwise, make a guess.
This method can be easily overriden by other submodules.
You can also override this method to change the order of name's
attributes
When this method is called, :attr:`~.name` already has unified and
trimmed whitespace.

Loading…
Cancel
Save