1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# Copyright (C) 2013 Daniel Reis
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU Affero General Public License as
8
# published by the Free Software Foundation, either version 3 of the
9
# License, or (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
16
# You should have received a copy of the GNU Affero General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
##############################################################################
21
from openerp.osv import orm
24
# Backport from trunk(v8) fix required. See Bug#1243628.
25
class ProjectIssue(orm.Model):
26
_inherit = 'project.issue'
28
def _get_default_partner(self, cr, uid, context=None):
30
If no other deafult is found, the current user is automatically
31
added as the Contact for the issue.
33
res = super(ProjectIssue, self
34
)._get_default_partner(cr, uid, context=context)
36
user = self.pool.get('res.users'
37
).browse(cr, uid, uid, context=context)
38
res = user.partner_id and user.partner_id.id
42
'partner_id': lambda s, cr, uid, c: s._get_default_partner(cr, uid, c),