1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# Avanzosc - Avanced Open Source Consulting
5
# Copyright (C) 2010 - 2011 Avanzosc <http://www.avanzosc.com>
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU Affero General Public License as
9
# published by the Free Software Foundation, either version 3 of the
10
# License, or (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU Affero General Public License for more details.
17
# You should have received a copy of the GNU Affero General Public License
18
# along with this program. If not, see http://www.gnu.org/licenses/.
20
##############################################################################
23
import decimal_precision as dp
26
from osv import fields
28
class l10n_es_tesoreria_plantilla(osv.osv):
29
_name = 'l10n.es.tesoreria.plantilla'
30
_description = 'Plantilla Predicción de tesorería'
33
'name': fields.char('Descripción', size=64),
34
'pagos_period': fields.one2many('l10n.es.tesoreria.pagos.period.plan', 'plan_tesoreria_id', 'Pagos Periodicos'),
35
'pagos_var': fields.one2many('l10n.es.tesoreria.pagos.var.plan', 'plan_tesoreria_id', 'Pagos Variables'),
38
l10n_es_tesoreria_plantilla()
40
class l10n_es_tesoreria_pagos_period_plan(osv.osv):
41
_name = 'l10n.es.tesoreria.pagos.period.plan'
42
_description = 'Plantilla Pagos Periodicos para la tesorería'
45
'name': fields.char('Descripción', size=64),
46
'fecha': fields.date('Fecha'),
47
'partner_id': fields.many2one('res.partner', 'Empresa'),
48
'diario': fields.many2one('account.journal', 'Diario', domain=[('type', '=', 'purchase')]),
49
'factura_id': fields.many2one('account.invoice', 'Factura', domain=[('type', '=', 'in_invoice')]),
50
'importe': fields.float('Importe', digits_compute=dp.get_precision('Account')),
51
'pagado': fields.boolean('Facturado/Pagado'),
52
'plan_tesoreria_id': fields.many2one('l10n.es.tesoreria.plantilla', 'Plantilla Tesorería'),
55
def onchange_factura(self, cr, uid, ids, factura_id, context=None):
57
invoice_obj = self.pool.get('account.invoice')
59
invoice = invoice_obj.browse(cr, uid, factura_id)
61
'diario': invoice.journal_id.id
63
return {'value': values}
65
l10n_es_tesoreria_pagos_period_plan()
67
class l10n_es_tesoreria_pagos_var_plan(osv.osv):
68
_name = 'l10n.es.tesoreria.pagos.var.plan'
69
_description = 'Plantilla Pagos Variables para la tesorería'
72
'name': fields.char('Descripción', size=64),
73
'partner_id': fields.many2one('res.partner', 'Empresa'),
74
'fecha': fields.date('Fecha'),
75
'diario': fields.many2one('account.journal', 'Diario', domain=[('type', '=', 'purchase')]),
76
'factura_id': fields.many2one('account.invoice', 'Factura', domain=[('type', '=', 'in_invoice')]),
77
'importe': fields.float('Importe', digits_compute=dp.get_precision('Account')),
78
'pagado': fields.boolean('Pagado'),
79
'plan_tesoreria_id': fields.many2one('l10n.es.tesoreria.plantilla', 'Plantilla Tesorería'),
82
def onchange_factura(self, cr, uid, ids, factura_id, context=None):
84
invoice_obj = self.pool.get('account.invoice')
86
invoice = invoice_obj.browse(cr, uid, factura_id)
88
'diario': invoice.journal_id.id
90
return {'value': values}
92
l10n_es_tesoreria_pagos_var_plan()
b'\\ No newline at end of file'