From 222db8514bebaee6925db71fdfbeea3eb4b23f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 17 Feb 2009 11:50:59 +0100 Subject: [PATCH] Replace name_get, name_search with get_rec_name and search_rec_name Return only id for default value of many2one --- inventory.py | 9 ++------- inventory.xml | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/inventory.py b/inventory.py index 6e0d2d712d..63944a867d 100644 --- a/inventory.py +++ b/inventory.py @@ -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() diff --git a/inventory.xml b/inventory.xml index 16cb11a706..a65bb009b1 100644 --- a/inventory.xml +++ b/inventory.xml @@ -34,7 +34,7 @@ this repository contains the full copyright notices and license terms. --> - +