Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • e-learning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

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

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
1 Responder
15168 Vistas
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)
Mejor respuesta

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

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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