Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar 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
  • Proyecto
  • 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

v17: call another form view from Automation Rules

Suscribirse

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

Se marcó esta pregunta
form_viewv17
1 Responder
2519 Vistas
Avatar
SmithJohn45

i have created an Automation Rule which works fine to generate Internal Transfer records, please refer to my topic below:

https://www.odoo.com/forum/help-1/v17-create-parent-child-record-in-another-table-on-save-242128

now i want to call or redirect to Internal Transfer view for this created record after creating the record which open form with it, kindly help how it can be done?

regards


-1
Avatar
Descartar
SmithJohn45
Autor

don't know why my most of the Questions are unAnswered during last one month... please if i have asked wrong question or trying to do in wrong direction, at least inform me for how to.
regards

SmithJohn45
Autor

i have tried this code to open Internal Transfer form view and admitting that this is wrong or wrong way to do this. please check and correct me.

i have copied the code from existing one to Create RFQ's and it also needs to correct.

# below code to open the form i copied from existing code
# which opens Purchase Order form view
# --------------------------------------------
def show_form():
purchase_ids = record.product_line_ids.purchase_order_line_id.order_id.ids
domain = [('id', 'in', purchase_ids)]
return {
'name': _('Internal Transfer Entries'),
'view_type': 'tree',
'view_mode': 'list,form',
'res_model': 'stock.picking',
'type': 'ir.actions.act_window',
'context': self.env.context,
'domain': domain,
}

regards

SmithJohn45
Autor

it SEEMS no one can help for this requirement ??

Avatar
Sachin
Mejor respuesta

Hi


Hope everything  is well


Default  code open the tree view right?


But you want to open form view is this correct? 

0
Avatar
Descartar
SmithJohn45
Autor

yes, to open / show newly created record.

Sachin

you can right like below
return {
'name': _('Internal Transfer Entries'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'stock.picking',
'type': 'ir.actions.act_window',
'context': self.env.context,
'res_id': record_id.id,
}
you can try this this will direct open form view of any record and you need to pass record_id in record_id.id
thanks

SmithJohn45
Autor

thanks a bunch @Sachin, add this with my code and confirm.

SmithJohn45
Autor

hi @Sachin
i have modified function with what you posted here as below but its not working... please all my code is in previous thread as mentioned link in my opening post, please check , i think i am being confusing. is there any need to call this function or i am missing something?

def show_form():
purchase_ids = record.product_line_ids.purchase_order_line_id.order_id.ids
domain = [('id', 'in', purchase_ids)]
return {
'name': _('Internal Transfer Entries'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'stock.picking',
'type': 'ir.actions.act_window',
'context': self.env.context,
'res_id': record_id.id,
}

Sachin

Record_Id is the transfer id that you want to open please assign correct transfer record to record_id

SmithJohn45
Autor

@Sachin thank you for your passion to help me. here is my complete code for Automation Rules, please check still its not working.

if record.request_status=='approved' and record.category_id.id in [11, 13]:
new_stock_picking = env['stock.picking'].create({
'picking_type_id': 5,
'company_id': 1,
'origin': record.name,
})

for approval_line in record.product_line_ids: # Assuming there's a related field linking approval request to lines
# Create stock.move record
move_data = {
'picking_id': int(new_stock_picking.id),
'picking_type_id': int(5),
'product_id': int(approval_line.product_id.id),
'product_uom_qty': int(approval_line.quantity),
'name': str(approval_line.product_id.name),
'company_id': int(1),
# 'product_uom': int(1),
'location_id': int(1),
'location_dest_id': int(1),
# Add other required fields
}
stock_move = env['stock.move'].create(move_data)

def show_form():
# purchase_ids = record.product_line_ids.purchase_order_line_id.order_id.ids
# domain = [('id', 'in', purchase_ids)]
return {
'name': _('Internal Transfer Entries'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'stock.picking',
'type': 'ir.actions.act_window',
'context': self.env.context,
'res_id': new_stock_picking.id,
# 'domain': domain,
}

regards

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

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

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
Ya es posible hacer Upgrade de v17 a v17.1 ?
v17
Avatar
Avatar
1
oct 25
1276
How to add a new Many2one field in res.config.settings? Resuelto
v17
Avatar
Avatar
Avatar
Avatar
4
oct 25
3656
Add field to ALL models in Odoo
v17
Avatar
Avatar
Avatar
2
sept 25
2310
How to disable Email notification - You have been assigned to Resuelto
v17
Avatar
Avatar
Avatar
Avatar
4
sept 25
7713
Selection Field Options Disappear from Database (PostgreSQL enum) on Module Upgrade
v17
Avatar
0
ago 25
1227
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información 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 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