Configurable model name_get() descriptions

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

Configurable model name_get() descriptions. Provides two 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

  • This section is meant to ask simple questions or leave a rating.
  • This author can leave a single reply to each comment.
  • 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.