Pular para o conteúdo
Odoo Menu
  • Entrar
  • Experimente grátis
  • Aplicativos
    Finanças
    • Financeiro
    • Faturamento
    • Despesas
    • Planilhas (BI)
    • Documentos
    • Assinar Documentos
    Vendas
    • CRM
    • Vendas
    • PDV Loja
    • PDV Restaurantes
    • Assinaturas
    • Locação
    Websites
    • Criador de Sites
    • e-Commerce
    • Blog
    • Fórum
    • Chat ao Vivo
    • e-Learning
    Cadeia de mantimentos
    • Inventário
    • Fabricação
    • PLM - Ciclo de Vida do Produto
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Funcionários
    • Recrutamento
    • Folgas
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Redes Sociais
    • Marketing por E-mail
    • Marketing por SMS
    • Eventos
    • Automação de Marketing
    • Pesquisas
    Serviços
    • Projeto
    • Planilhas de Horas
    • Serviço de Campo
    • Central de Ajuda
    • Planejamento
    • Compromissos
    Produtividade
    • Mensagens
    • Aprovações
    • Internet das Coisas
    • VoIP
    • Conhecimento
    • WhatsApp
    Aplicativos de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Varejo
    • Loja de livros
    • Loja de roupas
    • Loja de móveis
    • Mercearia
    • Loja de ferramentas
    • Loja de brinquedos
    Comida e hospitalidade
    • Bar e Pub
    • Restaurante
    • Fast Food
    • Hospedagem
    • Distribuidor de bebidas
    • Hotel
    Imóveis
    • Imobiliária
    • Escritório de arquitetura
    • Construção
    • Administração de propriedades
    • Jardinagem
    • Associação de proprietários de imóveis
    Consultoria
    • Escritório de Contabilidade
    • Parceiro Odoo
    • Agência de marketing
    • Escritório de advocacia
    • Aquisição de talentos
    • Auditoria e Certificação
    Fabricação
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Presentes corporativos
    Saúde e Boa forma
    • Clube esportivo
    • Loja de óculos
    • Academia
    • Profissionais de bem-estar
    • Farmácia
    • Salão de cabeleireiro
    Comércio
    • Handyman
    • Hardware e Suporte de TI
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência Ambiental
    • Aluguel de outdoors
    • Fotografia
    • Aluguel de bicicletas
    • Revendedor de software
    Navegar por todos os setores
  • Comunidade
    Aprenda
    • Tutoriais
    • Documentação
    • Certificações
    • Treinamento
    • Blog
    • Podcast
    Empodere a Educação
    • Programa de educação
    • Scale Up! Jogo de Negócios
    • Visite a Odoo
    Obtenha o Software
    • Baixar
    • Comparar edições
    • Releases
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Cadastre seu escritório contábil
    Obtenha os serviços
    • Encontre um parceiro
    • Encontre um Contador
    • Conheça um consultor
    • Serviços de Implementação
    • Referências de Clientes
    • Suporte
    • Upgrades
    Github YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Faça uma demonstração
  • Preços
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Financeiro
  • Inventário
  • PoS
  • Projeto
  • MRP
All apps
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
Ajuda

[solved] updating product attribute extra price from default extra prices

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
pricesproductsvariantsattributes
2 Respostas
4180 Visualizações
Avatar
BUDNIK PROGRAMMING

I am looking to manage prices by updating the attribute default additional price value.

I can understand that it may be unwise to have the default changing value change any additional set prices on individual products. Knowing the risks involved, Is there any way to force Odoo Online to use the default additional price only? Currently the default additional price will only apply after the price has been added and then the attribute is added to the product which is less than ideal. I have upwards of 10,000 variants I need to manage with the same attribute that will affect the price equally so changing the prices per product will be a hinderance to my users.


***updated with solution ***


After playing with chat gpt for a couple hours i have finally found my solution. If you want to update your pricing from the attribute menu rather than individually on each product and each attribute, which will take about 9 clicks per price extra value, you will need to create a server action that will do this update for you.


I activated the dev mode and under the technical section found the server action menu. Under this menu I created a server action called update attribute pricing that would execute code in the model 'product.template' . Then I used the following code to acheive this 


# Fetch all attribute lines associated with the product

attribute_lines = env['product.template.attribute.value'].search([('product_tmpl_id', '=', record.id)])


for attribute_line in attribute_lines:

    # Fetch the related product attribute value

    attribute_value = attribute_line.product_attribute_value_id

    

    if attribute_value:

        # Fetch the default extra price from the product attribute value model

        default_extra_price = attribute_value.default_extra_price

        

        # Compare and update if necessary

        if attribute_line.price_extra != default_extra_price:

            attribute_line.write({'price_extra': default_extra_price})

 

now with this action created and activating a contextual action I can select products I wish to update pricing on and when using the action it will fetch the default_price_extra and apply those values to the price_extra fields on each product.

0
Avatar
Cancelar
Avatar
BUDNIK PROGRAMMING
Autor Melhor resposta

Hi Ricardo, 

Thank you for the suggestion, however it would be highly unrealistic to manage my volume of products in this manner. In addition to the rest of my inventory I have 7 products that contain a minimum of 600 variants each along with a large variety of additional options that need to be priced out. I really would prefer to be able to manage prices from one menu such as the "default additional cost" in the configuration > attributes tab. 


update:

upon further exploration i believe I have found a solution that i think could work but chatgpt can only get me so far in making it function as intended.


I would like to create a server action that is either manually triggered or scheduled/automatically triggered to update the value price extra field (price_extra) under the Product Template Attribute Value model (product.template.attribute.value) to the default extra price value under the product.attribute.value model.


currently my server action expression looks like this [ update price_extra to product.attribute.value.default_extra_price ] however this does not work. I have tried a couple versions of this but no success. I would appreciate any insight or advice on this solution.



0
Avatar
Cancelar
Avatar
Ricardo Gross
Melhor resposta

It is also possible to create "Extra prices" for product variants, for specific pricelists (using the "Extra prices" button on products with variants):

0
Avatar
Cancelar
Está gostando da discussão? Não fique apenas lendo, participe!

Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!

Inscreva-se
Publicações relacionadas Respostas Visualizações Atividade
Can I set a default variant on website product page?
products variants attributes e-commerce
Avatar
Avatar
Avatar
Avatar
3
fev. 24
3065
How to Link Product Images to Colors While Maintaining Separate Listings in the "All Products" Section
products variants
Avatar
Avatar
Avatar
Avatar
3
jul. 25
3728
How to Add/Remove/Rename attributes without loosing all variants?
remove products add variants attributes
Avatar
Avatar
1
fev. 25
3593
Allow selection of multiple values from a single attribute of a product's variant Resolvido
products variants
Avatar
Avatar
Avatar
Avatar
3
set. 24
4491
How do you add product attributes to ALL products at the same time?
products attributes
Avatar
Avatar
1
out. 23
3060
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Open Source
  • Baixar
  • Github
  • Runbot
  • Traduções
Serviços
  • Odoo.sh Hosting
  • Suporte
  • Upgrade
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um Contador
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • Nossa empresa
  • Ativos da marca
  • Contato
  • Empregos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة 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 é um conjunto de aplicativos de negócios em código aberto que cobre todas as necessidades de sua empresa: CRM, comércio eletrônico, contabilidade, estoque, ponto de venda, gerenciamento de projetos, etc.

A proposta de valor exclusiva Odoo é ser, ao mesmo tempo, muito fácil de usar e totalmente integrado.

Site feito com

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