1
# -*- encoding: utf-8 -*-
2
###########################################################################
3
# Module Writen to OpenERP, Open Source Management Solution
4
# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
6
# Credits######################################################
7
# Coded by: nhomar@openerp.com.ve,
8
# Planified by: Nhomar Hernandez
9
# Finance by: Helados Gilda, C.A. http://heladosgilda.com.ve
10
# Audited by: Humberto Arocha humberto@openerp.com.ve
11
#############################################################################
12
# This program is free software: you can redistribute it and/or modify
13
# it under the terms of the GNU General Public License as published by
14
# the Free Software Foundation, either version 3 of the License, or
15
# (at your option) any later version.
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 General Public License for more details.
22
# You should have received a copy of the GNU General Public License
23
# along with this program. If not, see <http://www.gnu.org/licenses/>.
24
##############################################################################
26
from openerp.osv import fields, osv
27
from openerp.tools.translate import _
29
from tools import config
32
class mrp_routing_workcenter(osv.Model):
33
_inherit = "mrp.routing.workcenter"
35
def _calcular(self, cr, uid, ids, field_name, arg, context):
37
for i in self.browse(cr, uid, ids):
39
cost = i.hour_nbr*i.costo
44
'costo': fields.float('Costo Unitario', required=True),
45
'costo_total': fields.function(_calcular, method=True, type='float',
46
string='Costo Total', store=False),
49
'costo': lambda *a: 0.0,