1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
6
# Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU Affero General Public License as
10
# published by the Free Software Foundation, either version 3 of the
11
# License, or (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU Affero General Public License for more details.
18
# You should have received a copy of the GNU Affero General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
##############################################################################
23
from openerp.osv import fields, orm
25
class HrExpenseExpense(orm.Model):
26
_inherit = 'hr.expense.expense'
28
def line_get_convert(self, cr, uid, x, part, date, context=None):
29
res = super(HrExpenseExpense, self).line_get_convert(cr, uid, x, part,
32
res['analytics_id'] = x.get('analytics_id', False)
35
def move_line_get_item(self, cr, uid, line, context=None):
36
res = super(HrExpenseExpense, self).move_line_get_item(cr, uid, line,
39
res['analytics_id'] = line.analytics_id.id
43
class HrExpenseLine(orm.Model):
44
_inherit = 'hr.expense.line'
46
'analytics_id': fields.many2one('account.analytic.plan.instance',
47
'Analytic distribution'),