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

Creating a Journal entry , and getting the journal_id value from account.payment of posted payment

Suscribirse

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

Se marcó esta pregunta
account.movejournal_entryOdoo13.0account.payment
1 Responder
14981 Vistas
Avatar
Mudassar Syed

Hi hope you will be fine 

i am working on custom module in that module i'm getting all my values from account.payment model and also a journal_id of posted payment after when i populated my all value in custom module form in this form i am creating a journal entry again 

while creating a journal entry i am getting this ERROR

you cannot modify a journal entry linked to a posted payment. 

HERE IS MY CODE WHICH I'M USING TO PASS DATA FROM ACCOUNT.PAYMENT  MODEL TO B MODEL

    def go_to_pdc(self):

        if self.pdc_enable == 'pdc':

            if self.partner_type == 'customer':

                self.pdc_created = True

                context = {

                    'default_payment_id': self.id,

                    'default_name': self.partner_id.name + '-' + self.journal_id.name,

                    'default_bank_account_id': self.journal_id.bank_account_id.id,

                    'default_payee_user_id': self.partner_id.id,

                    'default_company_id': self.company_id.id,

                    'default_amount': self.amount,

                    'default_invoice_ids': [(6, 0, rec.multi_invoice_ids.invoice_id.ids) for rec in self],

                    'default_cheque_date': self.pdc_date,

                    'default_account_cheque_type': 'incoming',

                    'default_status1': 'registered',

                }

                return {

                    'name': _('Incoming'),

                    'view_type': 'form',

                    'view_mode': 'form',

                    'res_model': 'account.cheque',

                    'view_id': self.env.ref('bi_account_cheque.account_incoming_cheque_form_view').id,

                    'type': 'ir.actions.act_window',

                    'domain': [('payment_id', '=', self.id)],

                    'context': context

                }

HERE IS MY CODE FOR CREATING AN JOURNAL ENTRY OF B MODEL DATA

    def set_to_transfer(self):

        if self.amount:

            account_move_obj = self.env['account.move']

            move_lines = []

            if self.account_cheque_type == 'incoming':

                vals = {

                    'name': self.payee_user_id.name,

                    'date': self.cheque_receive_date,

                    'journal_id': self.journal_id.id,

                    'company_id': self.company_id.id,

                    'type': 'entry',

                    'state': 'draft',

                    'ref': self.name,

                    'account_cheque_id': self.id

                }

                account_move = account_move_obj.create(vals)


                debit_vals = {

                    'partner_id': self.payee_user_id.id,

                    'account_id': self.journal_id.default_debit_account_id.id,

                    'debit': self.amount,

                    'move_id': account_move.id,

                    'payment_id': self.payment_id.id,

                    'company_id': self.company_id.id,

                }

                move_lines.append((0, 0, debit_vals))


                credit_vals = {

                    'partner_id': self.payee_user_id.id,

                    'account_id': self.journal_id.clearing_account.id,

                    'credit': self.amount,

                    'move_id': account_move.id,

                    'payment_id': self.payment_id.id,

                    'company_id': self.company_id.id,

                }

                move_lines.append((0, 0, credit_vals))

                account_move.write({'line_ids': move_lines})


                account_move.post()

 

0
Avatar
Descartar
Avatar
Mudassar Syed
Autor Mejor respuesta

move_id = fields.Many2one('account.move')

move = { 'name': self.payment_id.name, 'date': self.cheque_receive_date, 'journal_id': self.journal_id.id, 'company_id': self.company_id.id, 'type': 'entry', 'state': 'draft', 'ref': self.sequence + '- ' + self.cheque_number + '- ' + 'Transferred', 'account_cheque_id': self.id, 'line_ids': [(0, 0, { 'name': self.payment_id.move_name, 'partner_id': self.payee_user_id.id, 'account_id': self.journal_id.default_debit_account_id.id, 'debit': self.amount}), (0, 0, { 'name': self.payment_id.move_name, 'partner_id': self.payee_user_id.id, 'account_id': self.journal_id.clearing_account.id, 'credit': self.amount })] } move_id = self.env['account.move'].create(move) move_id.post()
`               return self.write({'move_id': move_id.id})
                 By this code i just get rid of that Error , in this code i'm not creating dictionary of credit value and debit value separately 

0
Avatar
Descartar
¿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
Where are Journal Entries created from Account Payment Register?
account.move account.payment
Avatar
Avatar
Avatar
2
jun 25
3006
Fill up a field in the creation of a journal entry
account.move journal_entry
Avatar
0
jul 24
1995
Why does the action_register_payment function of account.move needs the create right? Resuelto
account.move account.payment
Avatar
Avatar
1
ago 23
4052
inherit 'account.move' and creating a new object 'accouont.move.oi' Resuelto
inheritance account.move Odoo13.0
Avatar
Avatar
1
sept 21
6298
Getting Warning Comparing Apples and oranges while trying to cancel the advance payment which is related to payment Resuelto
warning Odoo13.0 account.payment
Avatar
Avatar
1
jun 21
4533
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