Replace name_get, name_search with get_rec_name and search_rec_name

Return only id for default value of many2one
This commit is contained in:
Cédric Krier
2009-02-17 11:50:59 +01:00
parent 88d5eaca79
commit 222db8514b
2 changed files with 3 additions and 8 deletions
+2 -7
View File
@@ -27,18 +27,13 @@ class CreateInventoriesInit(WizardOSV):
location_ids = location_obj.search(cursor, user,
self.lost_found.domain, context=context)
if len(location_ids) == 1:
return location_obj.name_get(cursor, user, location_ids,
context=context)[0]
return location_ids[0]
return False
def default_company(self, cursor, user, context=None):
company_obj = self.pool.get('company.company')
if context is None:
context = {}
if context.get('company'):
return company_obj.name_get(cursor, user, context['company'],
context=context)[0]
return False
return context.get('company', False)
CreateInventoriesInit()
+1 -1
View File
@@ -34,7 +34,7 @@ this repository contains the full copyright notices and license terms. -->
<separator name="products" colspan="2"/>
<field name="categories" colspan="2">
<tree string="Categories" fill="1">
<field name="complete_name"/>
<field name="rec_name"/>
<field name="name" select="1" tree_invisible="1"/>
</tree>
</field>