2
# -*- encoding: utf-8 -*-
4
# Module Writen to OpenERP, Open Source Management Solution
6
# Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/
8
# info Vauxoo (info@vauxoo.com)
10
# Coded by: vauxoo consultores (info@vauxoo.com)
13
# This program is free software: you can redistribute it and/or modify
14
# it under the terms of the GNU Affero General Public License as
15
# published by the Free Software Foundation, either version 3 of the
16
# License, or (at your option) any later version.
18
# This program is distributed in the hope that it will be useful,
19
# but WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
# GNU Affero General Public License for more details.
23
# You should have received a copy of the GNU Affero General Public License
24
# along with this program. If not, see <http://www.gnu.org/licenses/>.
27
from openerp.osv import osv, fields
28
from openerp.tools.translate import _
32
class project_task_work(osv.Model):
33
_inherit = 'project.task.work'
35
def onchange_hours(self, cr, uid, ids, hours=None, context=None):
40
warning = { 'title': _('Warning!'), 'message': _('Are you sure that you want to charge hours in negative?')}
41
return { 'warning': warning}
43
def onchange_date(self, cr, uid, ids, date=None, context=None):
47
if date > time.strftime('%Y-%m-%d %H:%M:%S'):
48
warning = { 'title': _('Warning!'), 'message': _('Are you sure that you want to charge a future date?')}
49
return { 'warning': warning}
b'\\ No newline at end of file'