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

Update wizard quantity when product_uom_qty changes?

Suscribirse

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

Se marcó esta pregunta
python3odoo12
2 Respuestas
6142 Vistas
Avatar
Riyan

I have created a wizard which adds a product bundle to sale.order.line along with the quantity. The .py of wizard is hereby:

lass SaleView(models.TransientModel):
_name = "sale.order.wizard"

#list of field used in wizard given here
product_name = fields.Many2one("product.product", string="Product Name", required=True)
quantity = fields.Float(string="Quantity", default=1.0)


@api.multi
def button_send(self):
#this function is used to create a new product list in sale.order.line
#after clicking add pack button in wizard of sale.order.wizard
for line in self.product_name:
self.env['sale.order.line'].create({
'product_id': line.id,
'product_uom_qty': self.quantity,
'order_id': self._context.get('active_id')
})
return True            I want to update quantity when product_uom_qty in sale.order.line is changed. Does anyone have any idea how to do it. Please help me. Thanks in advance..

0
Avatar
Descartar
Avatar
Riyan
Autor Mejor respuesta

Thanks, But i know that already. I just want to update that field value in the sale order line when the qty field in sale order line is changed not the wizard value but the passed value. So if u have any idea then please provide me. Thanks!! 

1
Avatar
Descartar
Jainesh Shah(Aktiv Software)

Hello Riyan,

Okay so to update the Sale orderline field "product_uom_qty" based on the wizard field value "Quantity". You can try this below code.

@api.multi

def button_send(self):

context = self.env.context

active_ids = context.get('active_ids')

for sale_rec in self.env['sale.order'].browse(active_ids):

sale_rec.order_line = [(0, 0, {'product_id': self.product_name.id,

'product_uom_qty': self.quantity,})]

Riyan
Autor

The above button_send in my code sends a product_pack to the sale order line when the button is clicked. Now i want to update the quantity that was previously passed through the function button_send when product_uom_qty is changed in value. Does your code perform that i'm not sure if you have any idea it will be very helpful. Thanks... In simply you can say i want to reverse the action of button_send and place the value back again in sale.order.line.

Avatar
Jainesh Shah(Aktiv Software)
Mejor respuesta

Hello Riyan,


Transient Model never stores the values of fields in the database.
So we could not update the value of Quantity field which is defined in Transient Model.



Regards,




Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

   ​

0
Avatar
Descartar
Jacques-André Eberhard

Wrong, they are stored, then deleted after 5minutes(default value) by a cron task.

It might not be the answer of why we can't

¿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
I want to populate Customer/Vendor Many2one field based on Selection Field which has two selection 1.Sale Order, 2.Purchase Order. If it is Sale Order then Many2one field should have Customers from sale.order model and if it is Purchase Order then Many2one field should have Vendors from purchase.order model. v:odoo12 Resuelto
python3 odoo12
Avatar
Avatar
Avatar
3
dic 22
4152
How to make sign up menu in website? Resuelto
python3 odoo12
Avatar
Avatar
2
abr 20
5231
Multi Assign to one task?
python3 odoo12
Avatar
Avatar
1
abr 20
4172
How to run code in the background for longer period of time without blocking UI?
python3 odoo12
Avatar
Avatar
Avatar
2
sept 19
10013
sending JSON data with 400 status
controller python3 odoo12
Avatar
0
jun 21
3972
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