From 9ac23402f0d0c01bf749192251595dec35ef371e Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 7 Apr 2011 10:31:42 +0530 Subject: [PATCH 01/15] [ADD]: account_analytic_plans for config wizard bzr revid: ksa@tinyerp.co.in-20110407050142-5xkt2t1fd03qac03 --- addons/account_analytic_plans/__init__.py | 4 ++-- addons/account_analytic_plans/__openerp__.py | 3 ++- .../account_analytic_plans/installer_view.xml | 22 +++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 addons/account_analytic_plans/installer_view.xml diff --git a/addons/account_analytic_plans/__init__.py b/addons/account_analytic_plans/__init__.py index 067aa84d267..6f0609db41d 100644 --- a/addons/account_analytic_plans/__init__.py +++ b/addons/account_analytic_plans/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## diff --git a/addons/account_analytic_plans/__openerp__.py b/addons/account_analytic_plans/__openerp__.py index dab9e83c75a..1404f8e9a92 100644 --- a/addons/account_analytic_plans/__openerp__.py +++ b/addons/account_analytic_plans/__openerp__.py @@ -69,7 +69,8 @@ of distribution models. 'account_analytic_plans_view.xml', 'account_analytic_plans_report.xml', 'wizard/analytic_plan_create_model_view.xml', - 'wizard/account_crossovered_analytic_view.xml' + 'wizard/account_crossovered_analytic_view.xml', + '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/installer_view.xml new file mode 100644 index 00000000000..6249c3ab7ca --- /dev/null +++ b/addons/account_analytic_plans/installer_view.xml @@ -0,0 +1,22 @@ + + + + + + Analytic Plan + ir.actions.act_window + account.analytic.plan + form + tree,form + + + + + 3 + always + + + + + + From 859e620f0acd21dd837c275cfa5f34eb2a8f4295 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 7 Apr 2011 10:33:12 +0530 Subject: [PATCH 02/15] [ADD]: config wizard for crm bzr revid: ksa@tinyerp.co.in-20110407050312-0qyqxjwdffxlnrcr --- addons/crm/crm_installer_view.xml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/addons/crm/crm_installer_view.xml b/addons/crm/crm_installer_view.xml index 35ff5a0a7cc..b75a105559f 100644 --- a/addons/crm/crm_installer_view.xml +++ b/addons/crm/crm_installer_view.xml @@ -64,5 +64,36 @@ always + + + Sales Team + ir.actions.act_window + crm.case.section + form + tree,form + + + + + + 3 + always + + + + Sales Stages + ir.actions.act_window + crm.case.stage + form + tree,form + + + + + + 3 + always + + From fd7f8d0226973c360d760635955db16b28fabfbe Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 7 Apr 2011 10:34:08 +0530 Subject: [PATCH 03/15] [ADD]: config wizard for fetchmail bzr revid: ksa@tinyerp.co.in-20110407050408-02ysimrgtex3irtz --- addons/fetchmail/__openerp__.py | 1 + addons/fetchmail/installer_view.xml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 addons/fetchmail/installer_view.xml diff --git a/addons/fetchmail/__openerp__.py b/addons/fetchmail/__openerp__.py index 1ffe731996e..49215ed12d0 100644 --- a/addons/fetchmail/__openerp__.py +++ b/addons/fetchmail/__openerp__.py @@ -42,6 +42,7 @@ Fetch email from POP / IMAP servers. "fetchmail_view.xml", "fetchmail_data.xml", 'security/ir.model.access.csv', + 'installer_view.xml' ], 'demo_xml': [ diff --git a/addons/fetchmail/installer_view.xml b/addons/fetchmail/installer_view.xml new file mode 100644 index 00000000000..74b9b898d71 --- /dev/null +++ b/addons/fetchmail/installer_view.xml @@ -0,0 +1,19 @@ + + + + + POP/IMAP Server + ir.actions.act_window + email.server + form + tree,form + + + + + + 4 + always + + + \ No newline at end of file From 5ea5e93f4aede2e1dcc8ce0357c31a5b89b0669a Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 7 Apr 2011 10:35:12 +0530 Subject: [PATCH 04/15] [ADD]: config wizard for hr bzr revid: ksa@tinyerp.co.in-20110407050512-ou6xehe7l1s4eej9 --- addons/hr/hr_installer.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/addons/hr/hr_installer.xml b/addons/hr/hr_installer.xml index 5ccbaefa3f5..388668b7456 100644 --- a/addons/hr/hr_installer.xml +++ b/addons/hr/hr_installer.xml @@ -55,5 +55,21 @@ always + + Employee + ir.actions.act_window + hr.employee + form + tree,form + + + + + + 3 + always + + + From cbfe43975a95dae4379715bfc0301b87eeb46af8 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 7 Apr 2011 10:36:35 +0530 Subject: [PATCH 05/15] [ADD]: config wizard for hr_evaluation bzr revid: ksa@tinyerp.co.in-20110407050635-6wvhwajq88x712id --- addons/hr_evaluation/__openerp__.py | 3 ++- addons/hr_evaluation/installer_view.xml | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 addons/hr_evaluation/installer_view.xml diff --git a/addons/hr_evaluation/__openerp__.py b/addons/hr_evaluation/__openerp__.py index 1a611768d7e..11f6b236582 100644 --- a/addons/hr_evaluation/__openerp__.py +++ b/addons/hr_evaluation/__openerp__.py @@ -47,7 +47,8 @@ in the form of pdf file. Implements a dashboard for My Current Evaluations "wizard/hr_evaluation_mail_view.xml", "hr_evaluation_view.xml", "report/hr_evaluation_report_view.xml", - "board_hr_evaluation_view.xml" + "board_hr_evaluation_view.xml", + 'installer_view.xml' ], "test": ["test/test_hr_evaluation.yml"], "active": False, diff --git a/addons/hr_evaluation/installer_view.xml b/addons/hr_evaluation/installer_view.xml new file mode 100644 index 00000000000..2e5f8ef0e34 --- /dev/null +++ b/addons/hr_evaluation/installer_view.xml @@ -0,0 +1,19 @@ + + + + + Department + ir.actions.act_window + hr.department + form + tree,form + + + + + + 3 + always + + + From 6d9e38a658a64a7cd8045fae28d0fa2cbbe38682 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 7 Apr 2011 10:38:10 +0530 Subject: [PATCH 06/15] [ADD]: config wizard for hr_expense and data file bzr revid: ksa@tinyerp.co.in-20110407050810-t2bzvqpvmb4ikrkj --- addons/hr_expense/__init__.py | 4 ++-- addons/hr_expense/__openerp__.py | 4 +++- addons/hr_expense/hr_expense.py | 6 ++++++ addons/hr_expense/hr_expense_data.xml | 13 +++++++++++++ addons/hr_expense/hr_expense_view.xml | 2 +- addons/hr_expense/installer_view.xml | 20 ++++++++++++++++++++ 6 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 addons/hr_expense/hr_expense_data.xml create mode 100644 addons/hr_expense/installer_view.xml diff --git a/addons/hr_expense/__init__.py b/addons/hr_expense/__init__.py index 06f78648101..55a87f95400 100644 --- a/addons/hr_expense/__init__.py +++ b/addons/hr_expense/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## diff --git a/addons/hr_expense/__openerp__.py b/addons/hr_expense/__openerp__.py index 95d2b60300b..a648bea92bc 100644 --- a/addons/hr_expense/__openerp__.py +++ b/addons/hr_expense/__openerp__.py @@ -54,7 +54,9 @@ re-invoice your customer's expenses if your work by project. 'security/ir_rule.xml', 'report/hr_expense_report_view.xml', 'board_hr_expense_view.xml', - 'board_hr_expense_manager_view.xml' + 'board_hr_expense_manager_view.xml', + 'installer_view.xml', + 'hr_expense_data.xml' ], 'demo_xml': [ 'hr_expense_demo.xml', diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 1fdbb56f40b..995b5950019 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -229,6 +229,12 @@ class product_product(osv.osv): 'hr_expense_ok': fields.boolean('Can Constitute an Expense', help="Determines if the product can be visible in the list of product within a selection from an HR expense sheet line."), } + 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 }} + return res + product_product() class hr_expense_line(osv.osv): diff --git a/addons/hr_expense/hr_expense_data.xml b/addons/hr_expense/hr_expense_data.xml new file mode 100644 index 00000000000..33a7ec7604c --- /dev/null +++ b/addons/hr_expense/hr_expense_data.xml @@ -0,0 +1,13 @@ + + + + + + + Expenses + + + + \ No newline at end of file diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml index 5aa2fe5c38e..750404c40d9 100644 --- a/addons/hr_expense/hr_expense_view.xml +++ b/addons/hr_expense/hr_expense_view.xml @@ -189,7 +189,7 @@ form - + diff --git a/addons/hr_expense/installer_view.xml b/addons/hr_expense/installer_view.xml new file mode 100644 index 00000000000..7b194caa2c5 --- /dev/null +++ b/addons/hr_expense/installer_view.xml @@ -0,0 +1,20 @@ + + + + + Expences Product + ir.actions.act_window + product.product + form + tree,form + {'default_type':'service','default_procure_method':'make_to_stock','default_supply_method':'buy','default_purchase_ok':True,'default_sale_ok':False,'default_hr_expense_ok':True,'default_categ_id':19} + + + + + + 3 + always + + + From e544f257f0d74cd9f078790910e2c9f944794ddc Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 7 Apr 2011 10:39:10 +0530 Subject: [PATCH 07/15] [ADD]: config wizard for hr_requirement bzr revid: ksa@tinyerp.co.in-20110407050910-upj2d0kfh2wnypw7 --- addons/hr_recruitment/__openerp__.py | 1 + addons/hr_recruitment/installer_view.xml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 addons/hr_recruitment/installer_view.xml diff --git a/addons/hr_recruitment/__openerp__.py b/addons/hr_recruitment/__openerp__.py index c7f97cf3075..158d51fc491 100644 --- a/addons/hr_recruitment/__openerp__.py +++ b/addons/hr_recruitment/__openerp__.py @@ -47,6 +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' ], 'init_xml': [ 'hr_recruitment_data.xml' diff --git a/addons/hr_recruitment/installer_view.xml b/addons/hr_recruitment/installer_view.xml new file mode 100644 index 00000000000..2f31fb51c12 --- /dev/null +++ b/addons/hr_recruitment/installer_view.xml @@ -0,0 +1,19 @@ + + + + + Recruitment Stages + ir.actions.act_window + hr.recruitment.stage + form + tree,form + + + + + + 3 + always + + + From 2004662aae8b9842361ee486434afa0710f6e632 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 7 Apr 2011 10:39:58 +0530 Subject: [PATCH 08/15] [ADD]: config wizard for lunch bzr revid: ksa@tinyerp.co.in-20110407050958-k015asavo9bs2ik3 --- addons/lunch/__openerp__.py | 1 + addons/lunch/installer_view.xml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 addons/lunch/installer_view.xml diff --git a/addons/lunch/__openerp__.py b/addons/lunch/__openerp__.py index e5317cd8a94..ba980ad71e2 100644 --- a/addons/lunch/__openerp__.py +++ b/addons/lunch/__openerp__.py @@ -49,6 +49,7 @@ 'lunch_view.xml', 'lunch_report.xml', 'report/report_lunch_order_view.xml', + 'installer_view.xml' ], "demo_xml": ['lunch_demo.xml'], "test": ['test/test_lunch.yml', 'test/lunch_report.yml'], diff --git a/addons/lunch/installer_view.xml b/addons/lunch/installer_view.xml new file mode 100644 index 00000000000..7a1bd3fd6c4 --- /dev/null +++ b/addons/lunch/installer_view.xml @@ -0,0 +1,19 @@ + + + + + Lunch Products + ir.actions.act_window + lunch.product + form + tree,form + + + + + + 3 + always + + + From 9a5ac3b0fe01315b8e3b2ab27f4d7be3c6feab88 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 7 Apr 2011 11:30:32 +0530 Subject: [PATCH 09/15] [ADD]: config wizard for hr_timesheet_invoice bzr revid: ksa@tinyerp.co.in-20110407060032-9mi1ci7f2pqgzs6o --- addons/hr_timesheet_invoice/__init__.py | 6 +- addons/hr_timesheet_invoice/__openerp__.py | 1 + addons/hr_timesheet_invoice/installer.py | 57 +++++++++++++++++++ .../hr_timesheet_invoice/installer_view.xml | 38 +++++++++++++ 4 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 addons/hr_timesheet_invoice/installer.py create mode 100644 addons/hr_timesheet_invoice/installer_view.xml diff --git a/addons/hr_timesheet_invoice/__init__.py b/addons/hr_timesheet_invoice/__init__.py index 223ee7ea0c6..2251ea84d0b 100644 --- a/addons/hr_timesheet_invoice/__init__.py +++ b/addons/hr_timesheet_invoice/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,12 +15,12 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## import hr_timesheet_invoice import wizard import report - +import installer # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py index 95682d00ef0..79fcd3ca9a6 100644 --- a/addons/hr_timesheet_invoice/__openerp__.py +++ b/addons/hr_timesheet_invoice/__openerp__.py @@ -47,6 +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' ], 'demo': [ 'hr_timesheet_invoice_demo.xml', diff --git a/addons/hr_timesheet_invoice/installer.py b/addons/hr_timesheet_invoice/installer.py new file mode 100644 index 00000000000..0834ca6017c --- /dev/null +++ b/addons/hr_timesheet_invoice/installer.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields, osv +from tools.translate import _ + +class hr_timesheet_invoice_installer(osv.osv): + _name = "hr.timesheet.invoice.installer" + _description = "Employee Invoice Data" + _columns = { + 'employee_id': fields.many2one('hr.employee', 'Employee', domain="['|',('product_id','=',False),('journal_id','=',False)]" ,required=True), + 'type': fields.many2one('product.product', 'Product',domain="[('type','=','service')]"), + 'timesheet_journal': fields.many2one('account.analytic.journal', 'Analytic Journal',domain="[('type','=','general')]"), + } + + def _get_user(self, cr, uid, context=None): + + emp_obj = self.pool.get('hr.employee') + emp_id = emp_obj.search(cr, uid, ['|',('user_id', '=', uid),('product_id','=',False),('journal_id','=',False)], context=context) + if not emp_id: + raise osv.except_osv(_("Warning"), _("No employee defined for this user")) + return emp_id and emp_id[0] or False + + _defaults = { + 'employee_id': _get_user + } + +hr_timesheet_invoice_installer() + +class hr_timesheet_invoice_wizard(osv.osv): + _name = "hr.timesheet.invoice.wizard" + _description = "Timesheet Invoice" + _columns = { + 'emp_ids':fields.one2many('hr.timesheet.invoice.installer', 'timesheet_journal', 'Employee details'), + } + +hr_timesheet_invoice_wizard() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_timesheet_invoice/installer_view.xml b/addons/hr_timesheet_invoice/installer_view.xml new file mode 100644 index 00000000000..3d4fdc9c23e --- /dev/null +++ b/addons/hr_timesheet_invoice/installer_view.xml @@ -0,0 +1,38 @@ + + + + + Employee Invoice Data + hr.timesheet.invoice.wizard + form + +
+ + + + + + + +
+
+
+ + + Employee Invoice Data + ir.actions.act_window + hr.timesheet.invoice.wizard + form + form + + new + + + + + 3 + always + + +
+
\ No newline at end of file From f00fb439fc88c1a5455c93991561bcaa9c2a48b0 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 7 Apr 2011 18:59:56 +0530 Subject: [PATCH 10/15] [IMP]: Improvement bzr revid: ksa@tinyerp.co.in-20110407132956-1o67jgwlmahvvi3m --- addons/account_analytic_plans/installer_view.xml | 2 +- addons/crm/crm_installer_view.xml | 4 ++-- addons/fetchmail/installer_view.xml | 2 +- addons/hr/hr_installer.xml | 2 +- addons/hr_evaluation/installer_view.xml | 2 +- addons/hr_expense/installer_view.xml | 2 +- addons/hr_recruitment/installer_view.xml | 2 +- addons/hr_timesheet_invoice/installer.py | 2 +- addons/hr_timesheet_invoice/installer_view.xml | 6 +++--- addons/lunch/installer_view.xml | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/addons/account_analytic_plans/installer_view.xml b/addons/account_analytic_plans/installer_view.xml index 6249c3ab7ca..f394732a8c1 100644 --- a/addons/account_analytic_plans/installer_view.xml +++ b/addons/account_analytic_plans/installer_view.xml @@ -3,7 +3,7 @@ - Analytic Plan + Account Analytic Plans ir.actions.act_window account.analytic.plan form diff --git a/addons/crm/crm_installer_view.xml b/addons/crm/crm_installer_view.xml index b75a105559f..da59ec7f96e 100644 --- a/addons/crm/crm_installer_view.xml +++ b/addons/crm/crm_installer_view.xml @@ -66,7 +66,7 @@ - Sales Team + Create sales team ir.actions.act_window crm.case.section form @@ -81,7 +81,7 @@ - Sales Stages + Review Sales Stages ir.actions.act_window crm.case.stage form diff --git a/addons/fetchmail/installer_view.xml b/addons/fetchmail/installer_view.xml index 74b9b898d71..a3250fd6911 100644 --- a/addons/fetchmail/installer_view.xml +++ b/addons/fetchmail/installer_view.xml @@ -2,7 +2,7 @@ - POP/IMAP Server + Setup Your Mail server ir.actions.act_window email.server form diff --git a/addons/hr/hr_installer.xml b/addons/hr/hr_installer.xml index 388668b7456..e549f638f43 100644 --- a/addons/hr/hr_installer.xml +++ b/addons/hr/hr_installer.xml @@ -56,7 +56,7 @@ - Employee + Create Your Employees ir.actions.act_window hr.employee form diff --git a/addons/hr_evaluation/installer_view.xml b/addons/hr_evaluation/installer_view.xml index 2e5f8ef0e34..dfadc640937 100644 --- a/addons/hr_evaluation/installer_view.xml +++ b/addons/hr_evaluation/installer_view.xml @@ -2,7 +2,7 @@ - Department + Define Your Department Structure ir.actions.act_window hr.department form diff --git a/addons/hr_expense/installer_view.xml b/addons/hr_expense/installer_view.xml index 7b194caa2c5..8d9f0d6b5e9 100644 --- a/addons/hr_expense/installer_view.xml +++ b/addons/hr_expense/installer_view.xml @@ -2,7 +2,7 @@ - Expences Product + Review Your Expenses Products ir.actions.act_window product.product form diff --git a/addons/hr_recruitment/installer_view.xml b/addons/hr_recruitment/installer_view.xml index 2f31fb51c12..9826a8c5ad1 100644 --- a/addons/hr_recruitment/installer_view.xml +++ b/addons/hr_recruitment/installer_view.xml @@ -2,7 +2,7 @@ - Recruitment Stages + Review Recruitment Stages ir.actions.act_window hr.recruitment.stage form diff --git a/addons/hr_timesheet_invoice/installer.py b/addons/hr_timesheet_invoice/installer.py index 0834ca6017c..e4c8cb8e182 100644 --- a/addons/hr_timesheet_invoice/installer.py +++ b/addons/hr_timesheet_invoice/installer.py @@ -27,7 +27,7 @@ class hr_timesheet_invoice_installer(osv.osv): _description = "Employee Invoice Data" _columns = { 'employee_id': fields.many2one('hr.employee', 'Employee', domain="['|',('product_id','=',False),('journal_id','=',False)]" ,required=True), - 'type': fields.many2one('product.product', 'Product',domain="[('type','=','service')]"), + 'product_id': fields.many2one('product.product', 'Product', domain="[('type','=','service')]"), 'timesheet_journal': fields.many2one('account.analytic.journal', 'Analytic Journal',domain="[('type','=','general')]"), } diff --git a/addons/hr_timesheet_invoice/installer_view.xml b/addons/hr_timesheet_invoice/installer_view.xml index 3d4fdc9c23e..31917373c13 100644 --- a/addons/hr_timesheet_invoice/installer_view.xml +++ b/addons/hr_timesheet_invoice/installer_view.xml @@ -2,7 +2,7 @@ - Employee Invoice Data + Define Your Employee's Invoice Data hr.timesheet.invoice.wizard form @@ -10,7 +10,7 @@ - + @@ -19,7 +19,7 @@ - Employee Invoice Data + Define Your Employee's Invoice Data ir.actions.act_window hr.timesheet.invoice.wizard form diff --git a/addons/lunch/installer_view.xml b/addons/lunch/installer_view.xml index 7a1bd3fd6c4..8cd51a47ea6 100644 --- a/addons/lunch/installer_view.xml +++ b/addons/lunch/installer_view.xml @@ -2,7 +2,7 @@ - Lunch Products + Define Your Lunch Products ir.actions.act_window lunch.product form From 29e1b1076303e0005b222059df21ebd6d579c9e5 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Fri, 8 Apr 2011 15:37:06 +0530 Subject: [PATCH 11/15] [IMP]: Improve config wizard for hr_timesheet_invoice bzr revid: ksa@tinyerp.co.in-20110408100706-ia968sq1w9q63u4h --- addons/hr_timesheet_invoice/installer.py | 55 ++++++++++++++----- .../hr_timesheet_invoice/installer_view.xml | 11 +++- 2 files changed, 50 insertions(+), 16 deletions(-) diff --git a/addons/hr_timesheet_invoice/installer.py b/addons/hr_timesheet_invoice/installer.py index e4c8cb8e182..8f68bd9d3d4 100644 --- a/addons/hr_timesheet_invoice/installer.py +++ b/addons/hr_timesheet_invoice/installer.py @@ -22,36 +22,61 @@ from osv import fields, osv from tools.translate import _ -class hr_timesheet_invoice_installer(osv.osv): +class hr_timesheet_invoice_installer(osv.osv_memory): _name = "hr.timesheet.invoice.installer" _description = "Employee Invoice Data" _columns = { 'employee_id': fields.many2one('hr.employee', 'Employee', domain="['|',('product_id','=',False),('journal_id','=',False)]" ,required=True), 'product_id': fields.many2one('product.product', 'Product', domain="[('type','=','service')]"), - 'timesheet_journal': fields.many2one('account.analytic.journal', 'Analytic Journal',domain="[('type','=','general')]"), + 'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal',domain="[('type','=','general')]"), + 'wizard_id': fields.many2one('hr.timesheet.invoice.wizard','Employee', required=True), } - def _get_user(self, cr, uid, context=None): - - emp_obj = self.pool.get('hr.employee') - emp_id = emp_obj.search(cr, uid, ['|',('user_id', '=', uid),('product_id','=',False),('journal_id','=',False)], context=context) - if not emp_id: - raise osv.except_osv(_("Warning"), _("No employee defined for this user")) - return emp_id and emp_id[0] or False - - _defaults = { - 'employee_id': _get_user - } hr_timesheet_invoice_installer() -class hr_timesheet_invoice_wizard(osv.osv): +class hr_timesheet_invoice_wizard(osv.osv_memory): _name = "hr.timesheet.invoice.wizard" _description = "Timesheet Invoice" _columns = { - 'emp_ids':fields.one2many('hr.timesheet.invoice.installer', 'timesheet_journal', 'Employee details'), + 'emp_ids':fields.one2many('hr.timesheet.invoice.installer', 'wizard_id', 'Wizard Reference'), } + def default_get(self, cr, uid, fields, context=None): + """ + To get default values for the object. + @param self: The object pointer. + @param cr: A database cursor + @param uid: ID of the user currently logged in + @param fields: List of fields for which we want default values + @param context: A standard dictionary + @return: A dictionary with default values for all field in ``fields`` + """ + if context is None: + context = {} + res = super(hr_timesheet_invoice_wizard, self).default_get(cr, uid, fields, context=context) + emp_obj = self.pool.get('hr.employee') + emp_id = emp_obj.search(cr, uid, ['|',('user_id', '=', uid),('product_id','=',False),('journal_id','=','')], context=context) + result = [] + data = {} + for emp in emp_obj.browse(cr, uid, emp_id, context=context): + data = {'employee_id':emp.id,'product_id':emp.product_id.id,'journal_id':emp.journal_id.id} + result.append(data) + if 'emp_ids' in fields: + res.update({'emp_ids': result}) + return res + + def employee_data(self, cr, uid, ids, context=None): + if context is None: + context = {} + hr_obj = self.pool.get('hr.employee') + data = {} + for emp in self.browse(cr, uid, ids, context=context): + for emp_data in emp.emp_ids: + emp_id = hr_obj.search(cr, uid, [('id', '=', emp_data.employee_id.id)], context=context) + hr_obj.write(cr, uid, emp_id, {'name': emp_data.employee_id.name,'product_id':emp_data.product_id.id or False, 'journal_id':emp_data.journal_id.id or ''}) + return {'type': 'ir.actions.act_window_close'} + hr_timesheet_invoice_wizard() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_timesheet_invoice/installer_view.xml b/addons/hr_timesheet_invoice/installer_view.xml index 31917373c13..ef63c30779e 100644 --- a/addons/hr_timesheet_invoice/installer_view.xml +++ b/addons/hr_timesheet_invoice/installer_view.xml @@ -11,9 +11,18 @@ - + +
+ + + + + +