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

Need Owl Props Update and Re-render the template in odoo 17 Dialog Service.

Suscribirse

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

Se marcó esta pregunta
OdooV17OwlSelectMenuDialog
1 Responder
5324 Vistas
Avatar
Tarikol Islam


Hello Guys, I'm facing a challenge in sale order product matrix. At above you can see, I added two SelectMenu owl component. By which I  can show and hide my table rows and columns. The actually facility also include adding a new variant too. I've give a screenshot below.

The New variant even added to the backend if I clicked the "Add New "XL" button. But it's not added/showing in the table. as because the dialog render the template for the first time only. If I just close the dialog and re-open it from the sale order line button it's also render the newly added variant too(for both, color and Size). Here is my patched code given below for creation of variants. I will love the help from you guys. This is the ProductmatrixDialog from product_matrix module.


patch(ProductMatrixDialog.prototype, {});


onCreateColor(newValue){
this.orm.call('sale.order.upload.wizard','add_new_variant',[this.props.record.model.config.resId,this.props.product_template_id,'Color',newValue]).then((data) => { });
newValue = "New Color Added: " + newValue +".";
this.notificationService.add(_t(newValue), {
title: "Success",
type: "success"
});
},
onCreateSize(newValue){
this.orm.call('sale.order.upload.wizard','add_new_variant',[this.props.record.model.config.resId,this.props.product_template_id,'Size',newValue]).then((data) => {});
newValue = "New Size Added: " + newValue +".";

this.notificationService.add(_t(newValue), {
title: "Success",
type: "success"
});
this.props.close()
},
0
Avatar
Descartar
Avatar
Tarikol Islam
Autor Mejor respuesta

I've solved this and this actually solved by a manually props update the variable. Though still its not totally working with the color but works fine for Sizes. Where for colors I get another way out. The updated code has given below in case of any help you may get. I bold the solution part.
 

    async onCreateColor(newValue){
var selectedColors = Array.from(this.state.selectedColors);
selectedColors.push(newValue)

var selectedSizes = Array.from(this.state.selectedSizes);

await this.orm.call('sale.order.upload.wizard','add_new_variant', ​ ​ ​[this.props.record.model.config.resId,this.props.product_template_id,'Color',newValue]).then((data) => {});
await this.orm.call('sale.order','get_matrix', [this.props.record.config.resId,this.props.product_template_id]).then((data) => {
this.props.header = data['header']
this.props.rows = data['matrix']
});
// I can hide all the rows at this point again
this.notificationService.add(_t("New Color Added: " + newValue +"."), {
title: "Success",
type: "success"
});

this.colorChoices.push({
value : newValue,
label : newValue,
});
this.onColorSelect(selectedColors);
this.onSizeSelect(selectedSizes);





},

async onCreateSize(newValue){
var selectedSizes = Array.from(this.state.selectedSizes);
await this.orm.call('sale.order.upload.wizard', 'add_new_variant', [this.props.record.model.config.resId,this.props.product_template_id,'Size',newValue]).then((data) => {});
this.notificationService.add(_t("New Size Added: " + newValue +"."), {
title: "Success",
type: "success",
});
// this part is for getting the variant matrix
await this.orm.call('sale.order','get_matrix', [this.props.record.config.resId,this.props.product_template_id]).then((data) => {
this.props.header = data['header']
this.props.rows = data['matrix']
});
this.sizeChoices.push({
value : newValue,
label : newValue,
});
selectedSizes.push(newValue);
this.onSizeSelect(selectedSizes);
},


Here get_matrix is the copy of _get_matrix(built-in) but private. I just return the same thing from this function. and assign it to the props.

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
Invalid Operation: Error while importing module 'dental_clinical_management'
ubuntu22.04 OdooV17
Avatar
Avatar
Avatar
Avatar
Avatar
5
ago 25
2090
Creating User Access for Tasks in Odoo with Limited Project,Task Permissions Resuelto
v17 OdooV17
Avatar
Avatar
1
feb 25
13453
Inheritance template OWL template
qweb template view Owl
Avatar
0
nov 24
1749
odoo v17 How to add an image and uom in a PDF list bom
OdooV17 Studio17
Avatar
0
nov 24
1871
Je veux faire une migration de JS odoo 15 vers 17
migrate OdooV17
Avatar
0
may 24
2102
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