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

how to pass sale.order active id into wizard?

Suscribirse

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

Se marcó esta pregunta
wizardidactive_id
3 Respuestas
21360 Vistas
Avatar
Eric

Hello, I created a wizard and have a many2one field that is related to the sale.order. I would like to pass in the sale.order active id to the many2one field that is on the wizard.

In the Sale Order form I have a button with the type set to action, and I am using the context to pass in the active id of the sale.order to the sale_order_id field

<button name="%(action_view_wiz_pay_auth_net)d" type="action" string="Pay with Authorize.net" context="{'sale_order_id': active_id}" class="oe_highlight" />

Here is my xml wizard action:

<record id="action_view_wiz_pay_auth_net" model="ir.actions.act_window">
        <field name="name">Credit Card Info</field>
        <field name="res_model">sale.auth.net.payment</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="view_wiz_auth_net_payment_form"/>
        <field name="target">new</field>
    </record>

here is the wizard form:

<record id="view_wiz_auth_net_payment_form" model="ir.ui.view">
        <field name="name">wiz.auth.net.payment Form View</field>
        <field name="model">sale.auth.net.payment</field>
        <field name="arch" type="xml">
            <form string="Authorize.net" version="7.0">
                <group>
                    <field name="cc_num" style="width:300px;"/>
                    <field name="exp_month" style="width:60px;"/>
                    <field name="exp_year" style="width:60px;"/>
                    <field name="ccv_num" style="width:60px;"/>
                    <field name="amount" />
                    <field name="has_dif_billing" />
                    <field name="sale_order_id" style="width:300px;"/>
                </group>
                <group attrs="{'invisible': [('has_dif_billing','=', False)]}">
                    <field name="partner_id" style="width:300px;"/>
                    <field name="billing_add" style="width:300px;"/>
                    <field name="billing_city" style="width:100px;"/>
                    <field name="billing_state" style="width:60px;"/>
                    <field name="billing_zip" style="width:60px;"/>
                </group>

                <footer>
                    <button name="make_payment" string="Pay Now" type="object" 
                        context="{'amount': amount, 
                                  'cc_num': cc_num,
                                  'exp_month': exp_month,
                                  'exp_year': exp_year,
                                  'ccv_num': ccv_num,
                                  'billing_add': billing_add,
                                  'billing_city': billing_city,
                                  'billing_state': billing_state,
                                  'billing_zip': billing_zip,
                                  'has_dif_billing': has_dif_billing,
                                  }" class="oe_highlight"/> or
                    <button string="Cancel" special="cancel" class="oe_link"/>
                </footer>
            </form>
        </field>
    </record>

I have another many2one field partner_id that is related to res.partners on my wizard which actually loads the partner that is related to the sale.order. Im not sure why the partner_id is loaded, but not the order_id in the wizard. Can anyone explain why? Thank you

0
Avatar
Descartar
Avatar
Med Said BARA
Mejor respuesta

Hi;

Maybe this Question + Answer can help you

1
Avatar
Descartar
Eric
Autor

Yes thank you. I had to set the _defaults = { 'sale_order_id': lambda self, cr, uid, context: context.get('sale_order_id', False), }

Avatar
Pakiza Rana
Mejor respuesta

check the first step of my answer at

https://www.odoo.com/forum/help-1/question/add-product-to-shopping-cart-from-external-site-114337

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
Odoo12: How to get the current ID of a record before it is created ?
current id active_id odoo12
Avatar
Avatar
Avatar
Avatar
Avatar
5
jul 23
18668
[v7] getting wizard ID
wizard id 7.0 getting
Avatar
Avatar
1
mar 15
7930
Load currnet record values when calling wizard Resuelto
wizard
Avatar
Avatar
1
dic 22
4252
What is wizard ? Resuelto
wizard
Avatar
Avatar
Avatar
3
nov 23
34385
Close wizard in onchange
wizard
Avatar
Avatar
4
jul 25
5636
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.

Sitio web hecho con

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