~vauxoo/addons-vauxoo/6.0-trunk

« back to all changes in this revision

Viewing changes to account_voucher_department/model/account_voucher.py

  • Committer: Jose Morales
  • Date: 2014-07-28 20:00:11 UTC
  • mfrom: (543.7.551 7.0-addons-vauxoo)
  • Revision ID: jose@vauxoo.com-20140728200011-csytovehrzwp24lr
[FORWARD PORT] 7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- encoding: utf-8 -*-
 
3
###############################################################################
 
4
#    Module Writen to OpenERP, Open Source Management Solution
 
5
#    Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
 
6
#    All Rights Reserved
 
7
############# Credits #########################################################
 
8
#    Coded by: Katherine Zaoral <kathy@vauxoo.com>
 
9
#    Planified by: Humberto Arocha <hbto@vauxoo.com>
 
10
#    Audited by: Humberto Arocha <hbto@vauxoo.com>
 
11
###############################################################################
 
12
#    This program is free software: you can redistribute it and/or modify
 
13
#    it under the terms of the GNU Affero General Public License as published
 
14
#    by the Free Software Foundation, either version 3 of the License, or
 
15
#    (at your option) any later version.
 
16
#
 
17
#    This program is distributed in the hope that it will be useful,
 
18
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
#    GNU Affero General Public License for more details.
 
21
#
 
22
#    You should have received a copy of the GNU Affero General Public License
 
23
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
24
###############################################################################
 
25
 
 
26
from openerp.osv import fields, osv, orm
 
27
from openerp.tools.translate import _
 
28
from openerp import tools
 
29
 
 
30
 
 
31
class account_voucher(osv.Model):
 
32
 
 
33
    _inherit = 'account.voucher'
 
34
    _columns = {
 
35
        'department_id': fields.many2one(
 
36
            'hr.department',
 
37
            string='Department',
 
38
            help='Department were the requester belongs.'),
 
39
    }
 
40
 
 
41
    _defaults = {
 
42
        'department_id': lambda self, cur, uid, cxt: self.pool.get('res.users').browse(cur, uid, uid, cxt).employee_ids[0].department_id.id,
 
43
    }