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

How to inherit invoice view (list/tree and form)?

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
treeviewinheritanceaccount.invoiceformview
1 Responder
12583 Visualizações
Avatar
Jean Donaires

Hello. I am creating a new module where I will inherit the tree view and form view from the account.invoice module.

So far I've found a lot of examples on how to inherit a form view. As far as i know I should be fine if I edit the my module's view.xml file and just do the following:

<record model="ir.ui.view" id="mymodule.list">
      <field name="name">mymodule list</field>
      <field name="model">mymodule.mymodule</field>
      <field name="inherit_id" ref="account.invoice_tree"/>
      <field name="mode">primary</field>
      <field name="arch" type="xml">
        <tree create="false" edit="false">
                    <field name="partner_id" groups="base.group_user" string="Customer"/>
                    <field name="date_invoice"/>
                    <field name="number"/>
                    ...
        </tree>
      </field>
    </record>

(I would do the same for the form view but with ref="account.invoice_form")


But when i try to do the tree view i get 2 errors.

1 of them regarding the create and delete records

Element '<tree create="false" edit="false">' cannot be located in parent view

The other one asking for partner_id (this one pops up when i delete "create=false" "edit=false" on the tree tag)

Field `partner_id` does not exist

The big picture in here is that. I want to extend fields on account.invoice (1 boolean and the other one string)

Then show the exact same account.invoice tree view on a custom module with the only difference that in this inherited custom tree view I will show those accounts with the boolean set on "true". So what I need right now is to inherit the account.invoice tree and form view, into my custom module. 

0
Avatar
Cancelar
Avatar
Ray Carnes (ray)
Melhor resposta

When you inherit a View in Odoo, the XML in the arch field is expected to redefine, not define.

Review the documentation at \https://www.odoo.com/documentation/11.0/reference/views.html#inheritance


The error is Odoo's way of telling you - "I looked for a tree node matching create and false the way you list it, but I couldn't find it in the view you are inheriting".

The <tree> node in this case is defining an ANCHOR to which your changes will be made.  After locating the TREE node, you can REPLACE the node, change the ATTRIBUTES of the node, or put something AFTER or BEFORE the node.


Instead of defining tree:

<tree create="false" edit="false">

You redefine tree:

<tree position="replace">
<tree create="false" edit="false">
<field name="..."/>
</tree>
</tree>

or, even better:

<tree position="attributes">
<attribute name="create">false</attribute>
<attribute name="edit">false</attribute>
</tree>

<field name="partner_id" position="after">
<field name="..."/>
</field>
3
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
From tree view to dynamic form view
treeview formview
Avatar
Avatar
1
set. 23
5373
Inheriting model new fields from res.partner model are not visible in the inherited form
inheritance formview delegation
Avatar
Avatar
Avatar
2
jul. 23
4136
How to show children elements in parent form view?
treeview inheritance models
Avatar
0
abr. 23
3717
Its possible to add a tree view inside a form view with group_by filter applied
treeview group_by formview
Avatar
Avatar
2
jun. 22
4717
How to redirect to form view after clicking row in custom SQL tree view? (14.0)
views treeview formview
Avatar
0
set. 21
3161
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