From 0fa464b1b79ffda86689ad0790b1ef33b0fce066 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Fri, 8 Apr 2011 18:27:58 +0530 Subject: [PATCH] [IMP]: Improve code bzr revid: ksa@tinyerp.co.in-20110408125758-6soa3t29oels77ym --- addons/account_analytic_plans/__init__.py | 1 - addons/account_analytic_plans/__openerp__.py | 2 +- ...iew.xml => account_analytic_plans_installer_view.xml} | 2 +- addons/crm/crm_installer_view.xml | 4 ++-- addons/fetchmail/__openerp__.py | 2 +- .../{installer_view.xml => fetchmail_installer_view.xml} | 0 addons/hr_evaluation/__openerp__.py | 2 +- ...staller_view.xml => hr_evaluation_installer_view.xml} | 0 addons/hr_expense/__openerp__.py | 2 +- addons/hr_expense/hr_expense.py | 6 +++++- ...{installer_view.xml => hr_expense_installer_view.xml} | 0 addons/hr_recruitment/__openerp__.py | 2 +- ...taller_view.xml => hr_recruitment_installer_view.xml} | 0 addons/hr_timesheet_invoice/__openerp__.py | 2 +- ..._view.xml => hr_timesheet_invoice_installer_view.xml} | 4 ++-- addons/hr_timesheet_invoice/installer.py | 9 ++++----- addons/lunch/__openerp__.py | 2 +- .../{installer_view.xml => lunch_installer_view.xml} | 2 +- 18 files changed, 22 insertions(+), 20 deletions(-) rename addons/account_analytic_plans/{installer_view.xml => account_analytic_plans_installer_view.xml} (94%) rename addons/fetchmail/{installer_view.xml => fetchmail_installer_view.xml} (100%) rename addons/hr_evaluation/{installer_view.xml => hr_evaluation_installer_view.xml} (100%) rename addons/hr_expense/{installer_view.xml => hr_expense_installer_view.xml} (100%) rename addons/hr_recruitment/{installer_view.xml => hr_recruitment_installer_view.xml} (100%) rename addons/hr_timesheet_invoice/{installer_view.xml => hr_timesheet_invoice_installer_view.xml} (93%) rename addons/lunch/{installer_view.xml => lunch_installer_view.xml} (94%) diff --git a/addons/account_analytic_plans/__init__.py b/addons/account_analytic_plans/__init__.py index 6f0609db41d..a5c371fa6ec 100644 --- a/addons/account_analytic_plans/__init__.py +++ b/addons/account_analytic_plans/__init__.py @@ -18,7 +18,6 @@ # along with this program. If not, see . # ############################################################################## - import account_analytic_plans import wizard import report diff --git a/addons/account_analytic_plans/__openerp__.py b/addons/account_analytic_plans/__openerp__.py index 1404f8e9a92..1240a336500 100644 --- a/addons/account_analytic_plans/__openerp__.py +++ b/addons/account_analytic_plans/__openerp__.py @@ -70,7 +70,7 @@ of distribution models. 'account_analytic_plans_report.xml', 'wizard/analytic_plan_create_model_view.xml', 'wizard/account_crossovered_analytic_view.xml', - 'installer_view.xml' + 'account_analytic_plans_installer_view.xml' ], 'demo_xml' : [], 'test' : ['test/acount_analytic_plans_report.yml'], diff --git a/addons/account_analytic_plans/installer_view.xml b/addons/account_analytic_plans/account_analytic_plans_installer_view.xml similarity index 94% rename from addons/account_analytic_plans/installer_view.xml rename to addons/account_analytic_plans/account_analytic_plans_installer_view.xml index f394732a8c1..4bc6c555611 100644 --- a/addons/account_analytic_plans/installer_view.xml +++ b/addons/account_analytic_plans/account_analytic_plans_installer_view.xml @@ -12,7 +12,7 @@ - 3 + 15 always diff --git a/addons/crm/crm_installer_view.xml b/addons/crm/crm_installer_view.xml index bd0914208e9..0f7ff03f6f3 100644 --- a/addons/crm/crm_installer_view.xml +++ b/addons/crm/crm_installer_view.xml @@ -76,7 +76,7 @@ - 3 + 10 always @@ -91,7 +91,7 @@ - 3 + 10 always diff --git a/addons/fetchmail/__openerp__.py b/addons/fetchmail/__openerp__.py index 49215ed12d0..24f6898f163 100644 --- a/addons/fetchmail/__openerp__.py +++ b/addons/fetchmail/__openerp__.py @@ -42,7 +42,7 @@ Fetch email from POP / IMAP servers. "fetchmail_view.xml", "fetchmail_data.xml", 'security/ir.model.access.csv', - 'installer_view.xml' + 'fetchmail_installer_view.xml' ], 'demo_xml': [ diff --git a/addons/fetchmail/installer_view.xml b/addons/fetchmail/fetchmail_installer_view.xml similarity index 100% rename from addons/fetchmail/installer_view.xml rename to addons/fetchmail/fetchmail_installer_view.xml diff --git a/addons/hr_evaluation/__openerp__.py b/addons/hr_evaluation/__openerp__.py index 11f6b236582..607f41aa111 100644 --- a/addons/hr_evaluation/__openerp__.py +++ b/addons/hr_evaluation/__openerp__.py @@ -48,7 +48,7 @@ in the form of pdf file. Implements a dashboard for My Current Evaluations "hr_evaluation_view.xml", "report/hr_evaluation_report_view.xml", "board_hr_evaluation_view.xml", - 'installer_view.xml' + 'hr_evaluation_installer_view.xml' ], "test": ["test/test_hr_evaluation.yml"], "active": False, diff --git a/addons/hr_evaluation/installer_view.xml b/addons/hr_evaluation/hr_evaluation_installer_view.xml similarity index 100% rename from addons/hr_evaluation/installer_view.xml rename to addons/hr_evaluation/hr_evaluation_installer_view.xml diff --git a/addons/hr_expense/__openerp__.py b/addons/hr_expense/__openerp__.py index a648bea92bc..613198c3200 100644 --- a/addons/hr_expense/__openerp__.py +++ b/addons/hr_expense/__openerp__.py @@ -55,7 +55,7 @@ re-invoice your customer's expenses if your work by project. 'report/hr_expense_report_view.xml', 'board_hr_expense_view.xml', 'board_hr_expense_manager_view.xml', - 'installer_view.xml', + 'hr_expense_installer_view.xml', 'hr_expense_data.xml' ], 'demo_xml': [ diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 995b5950019..f78b3da8114 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -230,9 +230,13 @@ class product_product(osv.osv): } def on_change_hr_expense_ok(self, cr, uid, id, hr_expense_ok): + if not hr_expense_ok: return {} - res = {'value' : {'type':'service','procure_method':'make_to_stock','supply_method':'buy','purchase_ok':True,'sale_ok' :False,'categ_id':19 }} + data_obj = self.pool.get('ir.model.data') + cat_id = data_obj._get_id(cr, uid, 'hr_expense', 'cat_expense') + categ_id = data_obj.browse(cr, uid, cat_id).res_id + res = {'value' : {'type':'service','procure_method':'make_to_stock','supply_method':'buy','purchase_ok':True,'sale_ok' :False,'categ_id':categ_id }} return res product_product() diff --git a/addons/hr_expense/installer_view.xml b/addons/hr_expense/hr_expense_installer_view.xml similarity index 100% rename from addons/hr_expense/installer_view.xml rename to addons/hr_expense/hr_expense_installer_view.xml diff --git a/addons/hr_recruitment/__openerp__.py b/addons/hr_recruitment/__openerp__.py index 158d51fc491..18c5b034624 100644 --- a/addons/hr_recruitment/__openerp__.py +++ b/addons/hr_recruitment/__openerp__.py @@ -47,7 +47,7 @@ system to store and search in your CV base. 'security/ir.model.access.csv', 'report/hr_recruitment_report_view.xml', 'board_hr_recruitment_statistical_view.xml', - 'installer_view.xml' + 'hr_recruitment_installer_view.xml' ], 'init_xml': [ 'hr_recruitment_data.xml' diff --git a/addons/hr_recruitment/installer_view.xml b/addons/hr_recruitment/hr_recruitment_installer_view.xml similarity index 100% rename from addons/hr_recruitment/installer_view.xml rename to addons/hr_recruitment/hr_recruitment_installer_view.xml diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py index 79fcd3ca9a6..5d5e41ecbb0 100644 --- a/addons/hr_timesheet_invoice/__openerp__.py +++ b/addons/hr_timesheet_invoice/__openerp__.py @@ -47,7 +47,7 @@ reports, etc.""", 'wizard/hr_timesheet_invoice_create_view.xml', 'wizard/hr_timesheet_invoice_create_final_view.xml', 'board_hr_timesheet_invoice.xml', - 'installer_view.xml' + 'hr_timesheet_invoice_installer_view.xml' ], 'demo': [ 'hr_timesheet_invoice_demo.xml', diff --git a/addons/hr_timesheet_invoice/installer_view.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_installer_view.xml similarity index 93% rename from addons/hr_timesheet_invoice/installer_view.xml rename to addons/hr_timesheet_invoice/hr_timesheet_invoice_installer_view.xml index ef63c30779e..274c215fd37 100644 --- a/addons/hr_timesheet_invoice/installer_view.xml +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_installer_view.xml @@ -22,7 +22,7 @@