Configurable model name_get() descriptions

by
Odoo          
v 7.0 Third Party 793
Download for 7.0 series
You bought this module and need support ? Click here !
Technical name base_util_refcodes
LicenseAGPL-3
Repositoryhttps://github.com/dreispt/odoo-addons.git#7.0
Read description for v 9.0 v 8.0 v 6.1

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

Please choose a rating from 1 to 5 for this module.