Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Register payment automatically

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
automaticpaymentvoucher
1 Responder
9980 Vistas
Avatar
Raffaele

Hallo, I'm implementing Odoo for a business where they need to register payment automatically, given these values:

  • payment date = invoice date

  • paid amount = invoice total amount

  • payment type = bank

I tried with the following code, but it fails with an error 

ValueError: "" while evaluating action_register_payment() 

It's likely I'm missing something about creating the voucher, which is a part that actually I don't know.

Code

In the invoice view: added a button 

<button name="invoice_paid" states="open" string="Invoice paid" class="oe_highlight" groups="base.group_user" />

that calls a transition by its signal

<record id="open_to_paid" model="workflow.transition">
<field name="act_from" ref="account.act_open"/>
<field name="act_to" ref="account.act_paid"/>
<field name="signal">invoice_paid</field>
</record>

the action of the act_paid activity has been improved

<record id="account.act_paid" model="workflow.activity">
<field name="action">action_register_payment()
confirm_paid()</field>
</record>

 and finally the action_register_payment():

def action_register_payment(self):
for inv in self:
journal_pool = self.env['account.journal']
journal_id = journal_pool.search([('company_id','=',inv.company_id.id), ('code','=','BNK2')])[0].id
journal = journal_pool.browse(journal_id)
account_id = journal.default_debit_account_id.id
vals = {
'currency_id': inv.currency_id.id,
'partner_id': inv.partner_id.id,
'amount': inv.amount_total,
'reference': inv.name,
'name': inv.number,
'type': 'payment',
'date': inv.date_invoice,
'period_id': inv.period_id.id,
'journal_id': journal_id,
'account_id': account_id,
'writeoff_amount': 0.0,
'paid': True,
'narration': 'Automatically set to paid'
}
id = voucher_pool.create(vals)
voucher_id = voucher_pool.browse(id)
voucher_id.signal_workflow('proforma_voucher')
voucher_pool = self.env['account.voucher']

0
Avatar
Descartar
Avatar
Kinner Vachhani
Mejor respuesta

Hi, 

The error seems to be coming form create method. Put an ipdb statement before 

id = voucher_pool.create(vals)

Could you paste the stack trace? 


1
Avatar
Descartar
Raffaele
Autor

I have installed Odoo via apt-get: do I need to launch it from terminal to get the trace of ipdb? If so, how can I launch Odoo manually?

Kinner Vachhani

Hi Raffaele, You need a manual start. I you can't then there is an alternative way to debug Print values thought logger.info(val) before voucher code create. Connect database through erppeek (pip install erppeek). $erppeek -d $voucher_obj = model('account.voucher') $voucher_obj.create(vals) Check the error message. Retry creating voucher until you get it right.

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
What payment processors does Odoo Subscriptions work with?
automatic payment charge
Avatar
Avatar
1
dic 22
2268
Invoice Payments and Bank Statements (7.0) different behavior than in 6.x
payment bank_statement voucher
Avatar
0
mar 15
4231
Batch Report [Qweb]
accounting payment voucher report
Avatar
0
mar 16
4667
What is the effect of the 'Exchange Rate' in payment voucher?
accounting reconciliation payment voucher
Avatar
0
mar 15
5494
How to create a record within a record creation ?
payment voucher record object
Avatar
0
mar 15
4374
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now