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

Reson For Error:-Field 'hide_inv_button' used in attributes must be present in view but is missing in odoo12 Community

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
1 Responder
15171 Visualizações
Avatar
Keerthi
Reason for Error:-
Field 'hide_inv_button' used in attributes must be present in view but is missing: - 'hide_inv_button' in attrs="{'invisible': [('hide_inv_button', '!=', True)]}"

My Model is:-
class StudentMarkList(models.Model):
_name = 'student.mark'
_rec_name = 'student_id'

student_id = fields.Many2one('student.student',string='StudentName')
branch= fields.Many2one('student.branch', string='Branch Name')
sub1= fields.Many2one('student.subject', string='Subjectname1')
mark1 =fields.Integer(string='Mark1')
sub2= fields.Many2one('student.subject', string='Subjectname2')
mark2 =fields.Integer(string='Mark2')
sub3= fields.Many2one('student.subject', string='Subjectname3')
mark3 =fields.Integer(string='Mark3')
total =fields.Integer(string='Total Mark',store="true",compute='_compute_total')
state = fields.Selection([
('confirmed', 'Confirm'),
], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange')
@api.depends('mark1','mark2','mark3')
def _compute_total(self):
for record in self:
record.total = record.mark1+record.mark2+record.mark3

@api.multi
def action_confirm(self):
self.state = 'confirmed'
self.hide_inv_button = False

My View is :-
<!-- Form View of Student MarkList-->
<record model="ir.ui.view" id="studentmark_form_view">
<field name="name">studentmark.form</field>
<field name="model">student.mark</field>
<field name="arch" type="xml">
<form string="StudentMark Form">
<header>
<button name="action_confirm" string="Confirm" type="object" class="oe_highlight"
attrs="{'invisible': [('hide_inv_button', '!=', True)]}"/>
</header>
<sheet>
<group>
<field name="student_id"/>
<field name="branch"/>
</group>
<notebook>
<page string="Marks">
<table>
<tr>
<td> Subject </td>
<td> Mark </td>
</tr>
<tr>
<td><field name="sub1"/> </td>
<td><field name="mark1"/> </td>
</tr>
<tr>
<td><field name="sub2"/> </td>
<td><field name="mark2"/> </td>
</tr>
<tr>
<td><field name="sub3"/> </td>
<td><field name="mark3"/> </td>
</tr>
</table>
</page>
</notebook>
Total Marks :-<field name="total"/>
</sheet>
</form>
</field>
</record>
Please Help..
Thanks in Advance...
0
Avatar
Cancelar
Avatar
Yenthe Van Ginneken (Mainframe Monkey)
Melhor resposta

Hi Aswathy,

In your XML you have the following piece of code:

<button name="action_confirm" string="Confirm" type="object" class="oe_highlight"
attrs="{'invisible': [('hide_inv_button', '!=', True)]}"/>

However, nowhere in the XML you have defined the field 'hide_inv_button'. Because of this Odoo cannot handle your invisible attribute as it does not know how to interpret or parse it. Simply add the 'hide_inv_button' somewhere in your form. If you don't want it visible you can hide it for users in the view while the condition will keep working:

<field name="hide_inv_button" invisible="1"/> 
<!-- Remove invisible="1" if you also want to show the field to the users -->

Regards,
Yenthe

2
Avatar
Cancelar
Keerthi
Autor

My button is not visible now..

I have changed like this

My model is:-

class StudentMarkList(models.Model):

_name = 'student.mark'

_rec_name = 'student_id'

student_id = fields.Many2one('student.student',string='StudentName')

branch= fields.Many2one('student.branch', string='Branch Name')

sub1= fields.Many2one('student.subject', string='Subjectname1')

mark1 =fields.Integer(string='Mark1')

sub2= fields.Many2one('student.subject', string='Subjectname2')

mark2 =fields.Integer(string='Mark2')

sub3= fields.Many2one('student.subject', string='Subjectname3')

mark3 =fields.Integer(string='Mark3')

total =fields.Integer(string='Total Mark',store="true",compute='_compute_total')

hide_inv_button =fields.Boolean(string='Invisibles')

state = fields.Selection([

('confirmed', 'Confirm'),

], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange')

@api.depends('mark1','mark2','mark3')

def _compute_total(self):

for record in self:

record.total = record.mark1+record.mark2+record.mark3

@api.multi

def action_confirm(self):

self.state = 'confirmed'

self.hide_inv_button = False

My View is:-

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

<field name="name">studentmark.form</field>

<field name="model">student.mark</field>

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

<form string="StudentMark Form">

<header>

<button name="action_confirm" string="Confirm" type="object" class="oe_highlight"

attrs="{'invisible': [('hide_inv_button', '!=', True)]}"/>

</header>

<sheet>

<group>

<field name="student_id"/>

<field name="branch"/>

<field name="hide_inv_button" invisible="1"/>

</group>

<notebook>

<page string="Marks">

<table>

<tr>

<td> Subject </td>

<td> Mark </td>

</tr>

<tr>

<td><field name="sub1"/> </td>

<td><field name="mark1"/> </td>

</tr>

<tr>

<td><field name="sub2"/> </td>

<td><field name="mark2"/> </td>

</tr>

<tr>

<td><field name="sub3"/> </td>

<td><field name="mark3"/> </td>

</tr>

</table>

</page>

</notebook>

Total Marks :-<field name="total"/>

</sheet>

</form>

</field>

</record>

Yenthe Van Ginneken (Mainframe Monkey)

That is because your domain matches with the value of your boolean field. by default hide_inv_button is false, matching the domain to hide the button by default too.

Keerthi
Autor

When I set the default=True then it works

Thank You

Yenthe Van Ginneken (Mainframe Monkey)

Exactly, changes the default computation of the domain. Best of luck. :)

Tom Lo

Oh my god spent over 5 hours diving into Odoo source code with no lucky and what I missed is

`<field name="my_god_damn_field" invisible="1"/>`

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