How to Add a Form View in Odoo 16 | Odoo 16 Development Tutorial

preview_player
Показать описание
form view is used to display the data from a single record. We can create a form view using form tags. Which renders the single record.
#odoodevelopment

In this video, it explains about form view and its structural and semantic components and then how to create a form view in Odoo 16.
#odoo16 #odootraining

Connect With Us:
--------
Рекомендации по теме
Комментарии
Автор

Thank you for this video, so i define my form view but it's not that which render to user interface. Odoo continues to use default view as if i don't define custom form view. Thank you

My code :

<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record model="ir.ui.view">
<field
<field
<field name="arch" type="xml">
<form>
<header>
<button name="action_closProv" class="oe_highlight" string="Clôturer provisoirement" type="object" attrs="{'invisible': [('fiscal_year_state', 'in', ['closDef', 'closProv'])]}" help="Clôturer provisoirement votre année fiscale"/>
<button name="action_closDef" class="oe_highlight" string="Clôturer definitivement" type="object" attrs="{'invisible': [('fiscal_year_state', 'in', ['closDef', 'ouvert'])]}" help="Clôturer definitivement votre année fiscale"/>
<field name="fiscal_year_state" widget="statusbar" statusbar_visible="ouvert, closProv, closDef"/>
</header>
<sheet>
<group>
<group>
<field name="company_id" optional="hide"/>
<field name="fiscal_period_ids" optional="hide"
mode="tree, kanban"/>
</group>
<group>
<field name="code"/>
<field name="libelle"/>
<field name="journal_id"/>
</group>
<group>
<field name="date_from"/>
<field name="date_to"/>
</group>
<group>
<field name="compte_res_pos"/>
<field name="compte_res_neg"/>
</group>
</group>
</sheet>
</form>
</field>
</record>

<record model="ir.ui.view">
<field
<field
<field name="arch" type="xml">
<tree>
<field name="code"/>
<field name="libelle"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="journal_id"/>
<field name="fiscal_period_ids"/>
<field name="fiscal_year_state"/>
</tree>
</field>
</record>

<record
<field
<field
<field name="view_mode">tree, form</field>
<field name="help" type="html">
<p
Click here to create a new fiscal year.
</p>
</field>
</record>

</odoo>

funbrainbytemania
visit shbcf.ru