Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

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

Subscriure's

Get notified when there's activity on this post

This question has been flagged
1 Respondre
15193 Vistes
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
Descartar
Avatar
Yenthe Van Ginneken (Mainframe Monkey)
Best Answer

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
Descartar
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"/>`

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

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