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

"pricelist" does not show up on view of customer after automated installation

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
1 Responder
2945 Visualizações
Avatar
Perry

Please help on this issue, thanks in advance!

A) What I am looking for:

enable feature "Pricelists" defined by Odoo itself in automation code at INSTALL time so that the field "Pricelist" can be seen on tab 'Sales & Purchase' of page of any customer after the installation.


B) What I saw:

after installation of a customized module, 

1) I saw "Pricelists" is ENABLED on page "Settings -> Sales -> Pricing"

2) I did NOT see the field "pricelist" on the page "Sales -> Customers -> My Company(I created) -> Sales & Purchase"


C) What I expect:

I can see the field "pricelist" on the page "Sales -> Customers -> My Company(I created) -> Sales & Purchase" as well after AUTOMATED installation at B)-2).

Comparing with manual action: If I enable the checkbox of "Pricelists" on page "Settings -> Sales -> Pricing" MANUALLY, I can see the field "pricelist" afterwards.


D) What I did (reproducing steps):

1) create a new customized module 'Module_A';

2) in 'Module_A', create a new model which inherites 'res.config.settings' to set 'product.group_product_pricelist' with 'True' in 'ir.config_parameter';

- create a xml file and write code below

    <function model="res.config.settings" name="config_flsp_global_features_for_install" />

- define method "config_flsp_global_features_for_install" in the model to set the value when to install 'Module_A'

class ResConfigSettings(models.TransientModel):

    _inherit = 'res.config.settings'

    @api.model

    def config_flsp_global_features_for_install(self):

        # update ir.config_parameter to set the value globally

        self.env['ir.config_parameter'].sudo().set_param('product.group_product_pricelist', True)

        # update the field value in res.config.settings

        self.group_product_pricelist = True


E) My analysis:

- I am sure the code in D)-2) was run as "Pricelists" was ENABLED on page "Settings -> Sales -> Pricing";

- I also tried method get_values() and set_values() in model 'res.config.settings', but it did not work;

- I think the value has been set in database, even in the model field 'group_product_pricelist' at running time because I set it in code, but the problem is that the view of customer(res.partner) does not refer its updated value and the field "Pricelist" is missing; 

- definition of the field "Pricelist" on customer's view in addons\product\views\res_partner_views.xml

<field name="property_product_pricelist" groups="product.group_product_pricelist" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}"/>

- in my manual test, the value set is initialized on client view, so in addition to the value update in model and in database, there must be some actions done at the same time to refresh customer(res.partner)'s view with the new value, which I do not know.

0
Avatar
Cancelar
Niyas Raphy (Walnut Software Solutions)

Will this help? https://www.youtube.com/watch?v=mCwg-X3NfjQ

Avatar
Ray Carnes (ray)
Melhor resposta

I would model your use of updating res.config.settings based on what we do at https://github.com/odoo/odoo/blob/14.0/addons/base_setup/tests/test_res_config.py#L40

ResConfig = self.env['res.config.settings']
default_values = ResConfig.default_get(list(ResConfig.fields_get()))
default_values.update({'group_product_pricelist': True})
ResConfig.create(default_values).execute()

You would leverage this code inside a Python function called via the post_init_hook attribute in the manifest, which would instruct Odoo to run a function that you put in __init__.py after the rest of your module is installed.

See https://www.odoo.com/documentation/14.0/developer/reference/module.html?highlight=post_init_hook#module-manifests and https://github.com/odoo/enterprise/blob/14.0/website_helpdesk_form/__init__.py for more information.

0
Avatar
Cancelar
Perry
Autor

Hi Ray,

It works in my case, you saved my day, thanks so much for your help!

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
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