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

View inheritance: New view cannot find the field in the extension of the parent view

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
viewinheritanceodoo10
4 Respostas
8206 Visualizações
Avatar
Rumm

(odoo 10)I tried to create a primary form that inherits the vendor bills form to hide the field 'purchase_id'. 

The problem is that the system raised error saying the field was not found in the parent.

The field 'purchase_id' is originally in an extension view of the parent. I tried inheriting from the parent and the extension but both doesn't work. Can anyone help? 



Here is the code:

<record id="view_coop_member_sell_share_vendor_bill_form" model="ir.ui.view">
<field name="name">coop.member.sell.share.vendor.bill.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form" />
<field name="mode">primary</field>
<field eval="20" name="priority"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='purchase_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
                 ....


Here is the parent:

<record id="invoice_supplier_form" model="ir.ui.view">
<field name="name">account.invoice.supplier.form</field>
<field name="model">account.invoice</field>
<field name="priority">2</field>
<field name="arch" type="xml">
<form string="Vendor Bill">
<header>
                ...


Here is the extension where the 'purchase_id' is

<ecordid="view_invoice_supplier_purchase_form"model="ir.ui.view">
<field name="name">account.invoice.supplier.purchase</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<field name="reference" position="after" >
<field name="purchase_id" attrs="{'invisible': [('state', '=', 'purchase')]}" class="oe_edit_only"
options="{'no_create': True}"/>
</field>
             ....
0
Avatar
Cancelar
Avatar
Avinash Nk
Melhor resposta

Hi,

Change the inherit_id.

<field name="inherit_id" ref="purchase.view_invoice_supplier_purchase_form" />

Thank you

1
Avatar
Cancelar
Avatar
Rumm
Autor Melhor resposta

Hi Avinash, I tried that too but it didn't work

Error context:
View `coop.member.sell.share.vendor.bill.form`
[view_id: 852, xml_id: coop_member.view_coop_member_sell_share_vendor_bill_form, model: account.invoice, parent_id: 727]
2017-08-17 08:56:20,329 13512 INFO Test14AUG3 odoo.addons.base.ir.ir_ui_view: Can't validate view:
Field `purchase_id` does not exist
SOLVED:
Poor me. Just noticed that I did not add 'purchase' module to the 'depends' list in the manifest file.
'depends': ['product','sale','account','hr','purchase'],
Now either inherit from the parent or from the extension, both works!

Thank you!
0
Avatar
Cancelar
Avinash Nk

Try this code,

<data>

<record model="ir.ui.view" id="view_coop_member_sell_share_vendor_bill_form">

<field name="name">coop.member.sell.share.vendor.bill.form</field>

<field name="model">account.invoice</field>

<field name="inherit_id" ref="purchase.view_invoice_supplier_purchase_form"/>

<field name="arch" type="xml">

<xpath expr="//field[@name='purchase_id']" position="attributes">

<attribute name="invisible">1</attribute>

</xpath>

</field>

</record>

</data>

Rumm
Autor

SOLVED:

Poor me. Just noticed that I did not add 'purchase' module to the 'depends' list in the manifest file.

'depends': ['product','sale','account','hr','purchase'],

Now either inherit from the parent or from the extension, both works!

Thank you!

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
View inheritance Resolvido
view inheritance
Avatar
Avatar
1
mar. 20
4356
How do I remove fields from a view in a custom module? Resolvido
view inheritance
Avatar
Avatar
Avatar
Avatar
12
dez. 18
36182
Weird error "Expression cannot be located in parent view" in view inheritance Resolvido
view inheritance
Avatar
Avatar
1
jul. 16
7908
Two-level view inheritance, what am I missing?
view inheritance
Avatar
Avatar
2
mar. 15
6835
view inheritance in openerp
view inheritance
Avatar
Avatar
1
mar. 15
4346
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