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
    • e-learning
    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
    • Conocimientos
    • 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

I want to show only the products on a Purchase Order available from the Vendor I am purchasing from?

Suscribirse

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

Se marcó esta pregunta
purchase_orderproductsfiltering
2 Respuestas
10314 Vistas
Avatar
Community Question

If I select "ACME" as the Vendor, I only want products to be shown if I have defined ACME as a Vendor on the product.

0
Avatar
Descartar
Avatar
Ray Carnes (ray)
Mejor respuesta

Odoo 18.0 has a Catalog button, which already filters all products by the Vendor.


UPDATED for Odoo 16.0, Odoo 17.0 


You need to modify the domain on the product_id field:

Code:

<!-- for Odoo 16.0 -->
<field name="product_id" position="attributes">
  <attribute name="domain">
      [('purchase_ok', '=', True),
       ('seller_ids.partner_id','=',parent.partner_id),
       '|',('company_id', '=', False),('company_id', '=', parent.company_id)]
  </attribute>   
</field>   


<!-- for Odoo 17.0 -->
<field name="product_id" position="attributes">
  <attribute name="domain">
      [('purchase_ok', '=', True),
      ('seller_ids.partner_id','=',parent.partner_id),
      '|',('company_id', '=', False),('company_id', 'parent_of', parent.company_id)]
  </attribute>   
</field>   



For Odoo 13.0, Odoo 14.0 and Odoo 15.0:


You need to modify the domain on the product_id field:

Code:

<field name="product_id" position="attributes">
<attribute name="domain">[('seller_ids.name','=',parent.partner_id),
('purchase_ok', '=', True), '|',
('company_id', '=', False),
('company_id', '=', parent.company_id)]
</attribute>
</field>


This gives you this user experience:

3
Avatar
Descartar
iWesabe Technologies

Nice idea !!!. But seems this will raise error if multiple vendors added.

~ Shameem Babu

Ray Carnes (ray)

There is no problem with having as many Vendors as you need for a product.

Sveng

@Ray, tried this on v15EE no luck, also tried an xpath to select the field ... how can this be debugged? no msg's in the log.

Ray Carnes (ray)

Go back and check your work. I just tried this in v15EE and it worked fine. My guess is you didn't set the View Inheritance Mode.

Sveng

Have finally had some time to look at this again ... managed to get this to work but only when I switch off Settings->Purchase->Variant Grid Entry. Switching Variant Grid Entry on seems to add some code and additional inheritance on the order form which causes a conflict and/or override. Looks like I would have to inherit a different view??

Sveng

When Variant Grid Entry is turned on the product_id field is hidden and replace with product_template_id

<data><xpath expr="//tree/field[@name='product_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//tree/field[@name='product_id']" position="after">
<field name="product_template_id" string="Product" attrs="{ 'readonly': [('state', 'in', ('purchase', 'to approve','done', 'cancel'))], 'required': [('display_type', '=', False)], }" options="{'no_open': True}" context="{'partner_id': parent.partner_id}" widget="matrix_configurator"/>
<field name="product_template_attribute_value_ids" invisible="1"/>
<field name="product_no_variant_attribute_value_ids" invisible="1"/>
<field name="is_configurable_product" invisible="1"/>
</xpath>
<field name="partner_id" position="after">
<field name="grid" invisible="1"/>
<field name="grid_product_tmpl_id" invisible="1"/>
<field name="grid_update" invisible="1"/>
</field>
<xpath expr="//group[@name='other_info']" position="inside">
<field name="report_grids" groups="base.group_no_one"/>
</xpath>
</data>

What would be the correct action, inherit the inherited form and add a domain on product_template_id? Will this change be reflected in further inherited purchase.order.form views down stream?

What is / how is the resultant view determined (order?) when there are multiple inheritances and can there be sub-inheritances and what is processing order/result?

Also, is it possible to have conditional processing in an inherited view? Would the purchase.order.form contain the result of all previous inheritance processing and I could test weather product_id is hidden or not, if not hidden apply domain to product_id and if hidden apply to product_template_id?

Mikko

Would it be possible to modify this filter so that also product with no associated vendors could be picked on the RFQ? For example if no vendor is selected the list of products would not be filtered and full list of products would be shown?

Our users would like to have the filtered list 99% of the time, but would need to be able to pick also products with no vendors associated in some special cases. I'm trying to figure out a way to do this.

Sveng

Mikko, this should be possible with conditional domain attributes as listed here https://www.odoo.com/forum/help-1/14-how-to-set-conditional-domain-on-res-partner-based-on-move-type-in-account-move-form-193782 and here https://www.odoo.com/forum/help-1/conditionally-apply-domain-on-a-field-25468

Mikko

Thank you Sven for pointing me in the right direction and valuable links. I think I managed to achieve what we were looking for, just have to verify the result tomorrow. Much appreciated!

Mikko

Ok, so I got this solved, but our dev-server got overwriten along with my modifications. I had some notes, but it seems that I just can't get this to work again.

I had the following code on my notes. When I try to run this I get the following error "ValueError: Invalid leaf (True, '=', 744)". I guess there is something wrong with my syntax, but I just can't figure out what. Any thoughts?

<field name="product_id" position="attributes">
<attribute name="domain">['|', '&amp;', (True, '=',parent.partner_id),
('seller_ids.name','=',parent.partner_id),
('purchase_ok', '=', True), '|',
('company_id', '=', False),
('company_id', '=',parent.company_id),
'&amp;', (False, '=', parent.partner_id),
('purchase_ok', '=', True), '|',
('company_id', '=', False),
('company_id', '=', parent.company_id)]
</attribute>
</field>

Rickard Wallster

Hi Ray

In v17 there seems to be some changes in the parent fields. Do you know how to set the domain to get this code to work in v17?

Ray Carnes (ray)

I updated my answer.
The field on the Vendor Pricelist representing the Vendor was renamed from NAME to PARTNER_ID.

Please select JUST the section of XML relevant to your version if using Odoo 16.0, 17.0. (XML for both versions is shown but this customization will only work with one or the other).

Avatar
Sveng
Mejor respuesta

If you are using Settings->Purchase->Products->Variant Grid Entry as an option then you need to apply this change to product_template_id field and inherit from the  purchase_product_matrix.purchase_order_form_matrix view.

0
Avatar
Descartar
¿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
Purchase order manage for different suppliers
supplier purchase_order products
Avatar
Avatar
1
feb 19
4742
Multiple color values for one variant
products filtering eCommerce v17
Avatar
Avatar
Avatar
2
may 24
2894
Odoo15 - How To Compare Filter - Purchase Order - Quantity Ordered >= Quantity Received?
purchase_order filtering studio v15
Avatar
0
ene 23
2570
importing Purchase Order shown as a RFQ Resuelto
purchase_order
Avatar
Avatar
Avatar
2
may 25
2927
Create products with a sales price including VAT
products
Avatar
Avatar
Avatar
2
may 25
2259
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