2012-03-05 12:40:25 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
##############################################################################
|
|
|
|
#
|
2012-04-03 08:44:25 +00:00
|
|
|
# OpenERP, Open Source Business Applications
|
|
|
|
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
|
2012-03-05 12:40:25 +00:00
|
|
|
#
|
|
|
|
# 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 <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
|
2012-12-06 14:56:32 +00:00
|
|
|
from openerp.osv import fields, osv
|
|
|
|
from openerp.tools.translate import _
|
2012-03-05 12:40:25 +00:00
|
|
|
|
|
|
|
class project_configuration(osv.osv_memory):
|
2012-03-26 14:49:52 +00:00
|
|
|
_name = 'project.config.settings'
|
|
|
|
_inherit = 'res.config.settings'
|
2012-03-05 12:40:25 +00:00
|
|
|
|
|
|
|
_columns = {
|
2014-05-21 10:27:24 +00:00
|
|
|
'module_sale_service': fields.boolean('Generate tasks from sale orders',
|
2013-09-17 13:08:14 +00:00
|
|
|
help='This feature automatically creates project tasks from service products in sale orders. '
|
|
|
|
'More precisely, tasks are created for procurement lines with product of type \'Service\', '
|
|
|
|
'procurement method \'Make to Order\', and supply method \'Manufacture\'.\n'
|
2014-05-21 10:27:24 +00:00
|
|
|
'-This installs the module sale_service.'),
|
2012-09-12 07:14:13 +00:00
|
|
|
'module_pad': fields.boolean("Use integrated collaborative note pads on task",
|
2013-07-24 13:45:48 +00:00
|
|
|
help='Lets the company customize which Pad installation should be used to link to new pads '
|
2013-09-17 13:08:14 +00:00
|
|
|
'(for example: http://ietherpad.com/).\n'
|
|
|
|
'-This installs the module pad.'),
|
2012-09-12 07:14:13 +00:00
|
|
|
'module_project_timesheet': fields.boolean("Record timesheet lines per tasks",
|
2013-07-24 13:45:48 +00:00
|
|
|
help='This allows you to transfer the entries under tasks defined for Project Management to '
|
2013-09-17 13:08:14 +00:00
|
|
|
'the timesheet line entries for particular date and user, with the effect of creating, '
|
|
|
|
'editing and deleting either ways.\n'
|
|
|
|
'-This installs the module project_timesheet.'),
|
2012-09-12 07:14:13 +00:00
|
|
|
'module_project_issue': fields.boolean("Track issues and bugs",
|
2013-07-24 13:45:48 +00:00
|
|
|
help='Provides management of issues/bugs in projects.\n'
|
2013-09-17 13:08:14 +00:00
|
|
|
'-This installs the module project_issue.'),
|
2012-08-01 15:47:01 +00:00
|
|
|
'time_unit': fields.many2one('product.uom', 'Working time unit', required=True,
|
2015-01-12 12:29:33 +00:00
|
|
|
help='This will set the unit of measure used in projects and tasks.\n'
|
|
|
|
'Changing the unit will only impact new entries.'),
|
2012-09-12 07:14:13 +00:00
|
|
|
'module_project_issue_sheet': fields.boolean("Invoice working time on issues",
|
2013-07-24 13:45:48 +00:00
|
|
|
help='Provides timesheet support for the issues/bugs management in project.\n'
|
2013-09-17 13:08:14 +00:00
|
|
|
'-This installs the module project_issue_sheet.'),
|
2012-08-27 05:30:40 +00:00
|
|
|
'group_tasks_work_on_tasks': fields.boolean("Log work activities on tasks",
|
2012-04-27 07:17:01 +00:00
|
|
|
implied_group='project.group_tasks_work_on_tasks',
|
|
|
|
help="Allows you to compute work on tasks."),
|
2012-09-12 07:14:13 +00:00
|
|
|
'group_time_work_estimation_tasks': fields.boolean("Manage time estimation on tasks",
|
2012-04-27 07:17:01 +00:00
|
|
|
implied_group='project.group_time_work_estimation_tasks',
|
2012-05-29 10:32:38 +00:00
|
|
|
help="Allows you to compute Time Estimation on tasks."),
|
2012-09-12 07:14:13 +00:00
|
|
|
'group_manage_delegation_task': fields.boolean("Allow task delegation",
|
2012-05-30 05:29:02 +00:00
|
|
|
implied_group='project.group_delegate_task',
|
2012-06-25 08:43:13 +00:00
|
|
|
help="Allows you to delegate tasks to other users."),
|
2012-03-05 12:40:25 +00:00
|
|
|
}
|
2012-06-25 08:43:13 +00:00
|
|
|
|
|
|
|
def get_default_time_unit(self, cr, uid, fields, context=None):
|
2012-06-18 10:26:13 +00:00
|
|
|
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
2012-06-25 08:43:13 +00:00
|
|
|
return {'time_unit': user.company_id.project_time_mode_id.id}
|
2012-06-11 10:19:28 +00:00
|
|
|
|
2012-06-25 08:43:13 +00:00
|
|
|
def set_time_unit(self, cr, uid, ids, context=None):
|
|
|
|
config = self.browse(cr, uid, ids[0], context)
|
|
|
|
user = self.pool.get('res.users').browse(cr, uid, uid, context)
|
|
|
|
user.company_id.write({'project_time_mode_id': config.time_unit.id})
|
2012-03-05 12:40:25 +00:00
|
|
|
|
2012-08-28 06:19:48 +00:00
|
|
|
def onchange_time_estimation_project_timesheet(self, cr, uid, ids, group_time_work_estimation_tasks, module_project_timesheet):
|
|
|
|
if group_time_work_estimation_tasks or module_project_timesheet:
|
2012-09-20 08:49:58 +00:00
|
|
|
return {'value': {'group_tasks_work_on_tasks': True}}
|
|
|
|
return {}
|
2012-08-27 05:30:40 +00:00
|
|
|
|
2012-03-26 11:49:53 +00:00
|
|
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|