Configurable model name_get() descriptions

by
Odoo
v 6.1 v 7.0 v 8.0 v 9.0 Third Party 836
Download for v 9.0
Availability
Odoo Online
Odoo.sh
On Premise
Technical Name base_util_refcodes
LicenseLGPL-3
Versions 9.0 6.1 7.0 8.0
You bought this module and need support? Click here!

Configurable model name_get() descriptions. Provides reusable python methods that simplify custom object name rendering:

Methods provided:

name_tools.extended_name_get():
Given a template mask and a list of fields names, render the name_get(). All fields need to have value for the template to be applied. If not, uses the default name_ger (e.g. _rec_name)
name_tools.name_search():
Performs the search on a given list of fields.

Usage example:

``` from base_name_tools import name_tools

def name_get(self, cr, uid, ids, context=None):
return name_tools.extended_name_get(self, cr, uid, ids,
'[%(ref)s] %(name)s', ['ref', 'name'], context=context)

# ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ # template mask field list

def name_search(self, cr, user, name='', args=None, operator='ilike',

context=None, limit=100): return name_tools.extended_name_search(self, cr, user, name, args,

operator, context=context, limit=limit, keys=['ref', 'name'])

# ^^^^^^^^^^^^^^^^^^^^ # field list to search

```

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.