validar_nd.py
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
from odoo import models, fields, api
from odoo.exceptions import UserError
class vnt_validar_nd(models.TransientModel):
_name = 'vnt.validar_nd'
_description = 'Validar Notas de Débito'
vnd_notas = fields.Many2many(
string=u"Nota Débito",
comodel_name='asw.comprobante',
)
vnd_total = fields.Float(
string="Total",
)
vnd_cliente = fields.Many2one(
string='Cliente',
comodel_name='asw.cliente',
)
vnd_cobro = fields.Many2one(
string='Cobro',
comodel_name='vnt.cobros',
)
#metodo para abrir wizard pago
def cobrar_todo(self):
datos = {'pcw_cliente': self.vnd_cliente.id,
'pcw_totalcobrar': self.vnd_total,
'pcw_cobro_deu': self.vnd_cobro.id}
wizard = self.env['asw.pago_cliente_wizzard'].create(datos)
return {
'type': 'ir.actions.act_window',
'res_model': 'asw.pago_cliente_wizzard',
'view_mode': 'form',
'view_type': 'form',
'res_id': wizard.id,
'target': 'new',
}