.. highlight:: xml .. _form-view-guidelines: Form Views Guidelines ===================== .. sectionauthor:: Aline Preillon, Raphael Collet This document presents functional and technical guidelines for creating/organizing form views in Odoo. For each item, both the functional and technical aspects are explained. The goal of the new style of forms is to make Odoo easier to use, and to guide users through the system. Business Views -------------- Business views are targeted at regular users, not advanced users. Examples are: Opportunities, Products, Partners, Tasks, Projects, etc. .. image:: forms/oppreadonly.png :class: img-responsive In general, a business view is composed of 1. a status bar on top (with technical or business flow), 2. a sheet in the middle (the form itself), 3. a bottom part with History and Comments. Technically, the new form views are structured as follows in XML::
The Status Bar '''''''''''''' The purpose of the status bar is to show the status of the current record and the action buttons. .. image:: forms/status.png :class: img-responsive The Buttons ........... The order of buttons follows the business flow. For instance, in a sale order, the logical steps are: 1. Send the quotation 2. Confirm the quotation 3. Create the final invoice 4. Send the goods Highlighted buttons (in red by default) emphasize the logical next step, to help the user. It is usually the first active button. On the other hand, :guilabel:`cancel` buttons *must* remain grey (normal). For instance, in Invoice the button :guilabel:`Refund` must never be red. Technically, buttons are highlighted by adding the class "oe_highlight":: The Status .......... Uses the ``statusbar`` widget, and shows the current state in red. States common to all flows (for instance, a sale order begins as a quotation, then we send it, then it becomes a full sale order, and finally it is done) should be visible at all times but exceptions or states depending on particular sub-flow should only be visible when current. .. image:: forms/status1.png :class: img-responsive .. image:: forms/status2.png :class: img-responsive The states are shown following the order used in the field (the list in a selection field, etc). States that are always visible are specified with the attribute ``statusbar_visible``. ``statusbar_colors`` can be used to give a custom color to specific states. ::