Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

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

Odoberať

Get notified when there's activity on this post

This question has been flagged
1 Odpoveď
15173 Zobrazenia
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
Zrušiť
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
Zrušiť
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!

Registrácia
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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