From 0aaaa7a387bbdf39477c9392510e2de433c56fca Mon Sep 17 00:00:00 2001 From: "Bharat (OpenERP)" Date: Tue, 4 Oct 2011 17:24:41 +0530 Subject: [PATCH] hr : analytic_user_function- bad object naming convention lp bug: https://launchpad.net/bugs/866048 fixed bzr revid: bde@tinyerp.com-20111004115441-xl5pexqgakb6t9o8 --- .../analytic_user_function/analytic_user_function.py | 10 +++++----- .../analytic_user_function_view.xml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index ca3e9ef80c7..030a45db393 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -24,7 +24,7 @@ from tools.translate import _ class analytic_user_funct_grid(osv.osv): - _name="analytic_user_funct_grid" + _name="analytic.user.funct.grid" _description= "Relation table between users and products on a analytic account" _columns={ 'user_id': fields.many2one("res.users", "User", required=True,), @@ -39,7 +39,7 @@ class account_analytic_account(osv.osv): _inherit = "account.analytic.account" _columns = { - 'user_product_ids': fields.one2many('analytic_user_funct_grid', 'account_id', 'Users/Products Rel.'), + 'user_product_ids': fields.one2many('analytic.user.funct.grid', 'account_id', 'Users/Products Rel.'), } account_analytic_account() @@ -54,7 +54,7 @@ class hr_analytic_timesheet(osv.osv): # Take the first found... if nothing found => return False def _get_related_user_account_recursiv(self, cr, uid, user_id, account_id): - temp=self.pool.get('analytic_user_funct_grid').search(cr, uid, [('user_id', '=', user_id),('account_id', '=', account_id) ]) + temp=self.pool.get('analytic.user.funct.grid').search(cr, uid, [('user_id', '=', user_id),('account_id', '=', account_id) ]) account=self.pool.get('account.analytic.account').browse(cr, uid, account_id) if temp: return temp @@ -81,7 +81,7 @@ class hr_analytic_timesheet(osv.osv): return super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids, account_id) else: #get the old values from super and add the value from the new relation analytic_user_funct_grid - r = self.pool.get('analytic_user_funct_grid').browse(cr, uid, temp)[0] + r = self.pool.get('analytic.user.funct.grid').browse(cr, uid, temp)[0] res.setdefault('value',{}) res['value']= super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids, account_id)['value'] res['value']['product_id'] = r.product_id.id @@ -119,7 +119,7 @@ class hr_analytic_timesheet(osv.osv): temp = self._get_related_user_account_recursiv(cr, uid, user_id, account_id) if temp: #add the value from the new relation analytic_user_funct_grid - r = self.pool.get('analytic_user_funct_grid').browse(cr, uid, temp)[0] + r = self.pool.get('analytic.user.funct.grid').browse(cr, uid, temp)[0] res['value']['product_id'] = r.product_id.id #the change of product has to impact the amount, uom and general_account_id diff --git a/addons/analytic_user_function/analytic_user_function_view.xml b/addons/analytic_user_function/analytic_user_function_view.xml index 1863dd42fb5..763b3115814 100644 --- a/addons/analytic_user_function/analytic_user_function_view.xml +++ b/addons/analytic_user_function/analytic_user_function_view.xml @@ -5,7 +5,7 @@ analytic_user_funct_grid.tree - analytic_user_funct_grid + analytic.user.funct.grid tree @@ -17,7 +17,7 @@ analytic_user_funct_grid.form - analytic_user_funct_grid + analytic.user.funct.grid form
@@ -55,7 +55,7 @@ - + hr.timesheet.sheet.form.form