~vauxoo/addons-vauxoo/7.0-addons-vauxoo-send_email_add_follower-dev-julio

« back to all changes in this revision

Viewing changes to baremo/baremo.py

  • Committer: Miguel Delgado
  • Date: 2012-05-21 14:48:48 UTC
  • Revision ID: miguel.delgado07@gmail.com-20120521144848-v9lt237qbqh2cwdl

[ADD] se migraron los modulos de baremo, commission_payment y hr_salesman_commission
para que el proceso de calculo de comisiones funcionara igual que en version 5.0 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- encoding: utf-8 -*-
 
2
##############################################################################
 
3
#
 
4
#    OpenERP, Open Source Management Solution    
 
5
#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
 
6
#    nhomar.hernandez@netquatro.com
 
7
#
 
8
#    This program is free software: you can redistribute it and/or modify
 
9
#    it under the terms of the GNU General Public License as published by
 
10
#    the Free Software Foundation, either version 3 of the License, or
 
11
#    (at your option) any later version.
 
12
#
 
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 General Public License for more details.
 
17
#
 
18
#    You should have received a copy of the GNU General Public License
 
19
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
#
 
21
##############################################################################
 
22
from osv import osv
 
23
from osv import fields
 
24
from tools.translate import _
 
25
from tools import config
 
26
import decimal_precision as dp
 
27
 
 
28
class baremo_book(osv.osv):
 
29
    _name = 'baremo.book'
 
30
    
 
31
    _columns = {
 
32
        'name':fields.char('Baremo', size=64, required=True, readonly=False),
 
33
        'notes':fields.text('Notas', required=True, readonly=False),
 
34
        'bar_ids':fields.one2many('baremo', 'bar_id', 'Dias de Emision', required=False),
 
35
    }
 
36
    _defaults = {
 
37
        'name': lambda *a: 'DEBE ESCRIBIR UNA NOTA REFERENTE A ESTE BAREMO PARA SER USADO EN EL REPORTE DE COMISIONES, COMO POR EJEMPLO, LOS DESCUENTOS NEGATIVOS REPRESENTAN LOS SOBRE PRECIOS REALIZADOS A LOS PRODUCTOS PARA COMPENSAR EN PAGO RETARDADO POR PARTE DEL CLIENTE',
 
38
    }
 
39
baremo_book()
 
40
 
 
41
class baremo(osv.osv):
 
42
    """
 
43
    OpenERP Model : baremo
 
44
    """
 
45
    
 
46
    _name = 'baremo'
 
47
    _order = "number asc"
 
48
 
 
49
    _columns = {
 
50
        'name':fields.char('Nombre', size=64, required=True, readonly=False, help="Nombre del termino de Vencimiento"),
 
51
        'number': fields.integer('Dias', help="Dias desde emision de la factura", required=True),
 
52
        'disc_ids':fields.one2many('baremo.discount', 'disc_id', 'Comision x Dscto.', required=False, help="Comision x Dscto x Dia"),
 
53
        'bar_id':fields.many2one('baremo.book', 'Padre', required=False),
 
54
    }
 
55
    _defaults = {
 
56
        'name': lambda *a: None,
 
57
    }
 
58
baremo()
 
59
 
 
60
class baremo_discount(osv.osv):
 
61
    """
 
62
    OpenERP Model : baremo_discount
 
63
    """
 
64
    
 
65
    _name = 'baremo.discount'
 
66
    _order = "porc_disc asc"
 
67
    _columns = {
 
68
        'name':fields.char('Nombre', size=64, required=False, readonly=False, help="No Usado"),
 
69
        'porc_disc': fields.float('% Dcto', digits_compute=dp.get_precision('Commission'), help="% de Descuento por producto", required=True),
 
70
        'porc_com': fields.float('% Com.', digits_compute=dp.get_precision('Commission'), help="% de Comision @ porcentaje Descuento", required=True),
 
71
        'disc_id':fields.many2one('baremo', 'Baremo', required=False),
 
72
    }
 
73
    _defaults = {
 
74
        'name': lambda *a: None,
 
75
    }
 
76
baremo_discount()