Modele, module și aplicații

Modelele determină structura logică a unei baze de date și cum sunt stocate, organizate și manipulate datele. Altfel spus, un model este o tabelă de informații care poate fi legată cu alte tabele. Un model reprezintă de obicei un concept de afaceri, cum ar fi o comandă de vânzare, contact sau produs.

Modulele și aplicațiile conțin diverse elemente, cum ar fi modele, view-uri, fișiere de date, controlere web și date statice web.

Notă

Toate aplicațiile sunt module. Modulele mai mari, independente sunt de obicei denumite aplicații, în timp ce alte module servesc de obicei ca adiții la aceste aplicații.

Funcții sugerate

Când creați un nou model sau aplicație cu Studio, puteți alege să adăugați până la 14 funcții pentru a accelera procesul de creare. Aceste funcții predefinesc câmpuri, setări implicite și vizualizări care sunt de obicei folosite împreună pentru a oferi o anumită funcționalitate standard. Majoritatea acestora pot fi adăugate mai târziu, dar adăugarea lor de la început face procesul de creare a modelului mult mai ușor. De asemenea, aceste funcții interacționează împreună în unele cazuri pentru a crește utilitatea lor.

Example

Crearea unui model cu funcția Imagine și Stadii flux de activități activată adaugă imaginea în aspectul cardului din vederea Kanban.

Combinarea funcțiilor Picture și Stadii flux de activități în vederea Kanban

Detalii de contact

Selecting Contact details adds to the Form view a Many2One field linked to the Contact model and two of its Related Fields: Phone and Email. The Contact field is also added to the List view, and the Map view is activated.

Example

Detalii Contact în Form view

Alocare utilizator

Selecting User assignment adds to the Form view a Many2One field linked to the Contact model, with the following Domain: Share User is not set to only allow the selection of Internal Users. In addition, the many2one_avatar_user widget is used to display the user’s avatar. The Responsible field is also added to the List view.

Example

Funcția User assignment în Form view

Data & Calendar

Selecting Date & Calendar adds to the Form view a Date field and activates the Calendar view.

Interval de date & Gantt

Selecting Date range & Gantt adds to the Form view two Date fields next to each other: one to set a start date, the other to set an end date, using the daterange widget, and activates the Gantt view.

Stadii flux de activități

Selecting Pipeline stages activates the Kanban view, adds several fields such as Priority and Kanban State, and three stages: New, In Progress, and Done. The Pipeline status bar and the Kanban State field are added to the Form view. The Color field is added to the List view.

Notă

:guilabel:`Etape flux de activitățiț poate fi adăugat într-o etapă ulterioară.

Etichete

Selecting Tags adds to the Formular and Listă views a Tags field, creating a Tag model with preconfigured access rights in the process.

Imagine

Selecting Picture adds to the top-right of the Form view an Image field.

Notă

Picture poate fi adăugat într-o etapă ulterioară.

Linii

Selecting Lines: adds to the Form view a Lines field inside a Tab component.

Note

Selecting Notes adds to the Form view an Html field using the full width of the form.

Valoare monetară

Selecting Monetary value adds to the Formular and Listă views a Monetary field. The Grafic and Pivot views are also activated.

Notă

Un câmp Monedă este adăugat și ascuns din vizualizare.

Companie

Selecting Company adds to the Formular and Listă views a Many2One field linked to the Company model.

Notă

Acest lucru este util doar dacă lucrați într-o mediu multi-companii.

Sortare personalizată

Selectând Custom Sorting adaugă în List view o pictogramă de mână pentru a reordona înregistrările manual.

Example

Sortare personalizată în vizualizarea Listă

Chatter

Selectând Chatter adaugă în Form view funcționalități Chatter (trimiterea mesajelor, înregistrarea notelor și programarea activităților).

Notă

Chatter poate fi adăugat într-un stadiu ulterior.

Example

Funcționalitatea Chatter pe vizualizarea Form

Arhivare

Selectând Archiving adaugă în Formular și Listă acțiunea Archivare și ascunde înregistrările arhivate din căutări și vizualizări în mod implicit.

Exportă și importă personalizări

When you do any customization with Studio, a new module named studio_customization is added to your database. You can export this module as a ZIP file using the Studio Export function. The module can then be imported into another Odoo database. This may be useful, for example, when setting up a new module or for training purposes.

Notă

Exporting and importing customizations in this way, rather than using the standard Odoo export and import functions, means data is imported in a logical way. For example, if the module contains customers and sales orders, the customers are created first, since these are required for the sales orders to be created.

Export customizations

To export customizations, click the (Toggle Studio) button on the main Odoo dashboard, then Export, then either:

Configure data to export

To select specific models to export, click New on the Studio Export screen, then start typing the name of the relevant model or select it from the list.

Sfat

Click Preset to see a list of all models in your database with records that have been modified using Studio and all custom models created using Studio. To configure one of these models for export, click on the model to open it and make the required changes.

Tick the following options as relevant:

  • Demo: if the exported records should be considered as demo data when imported.

  • Attachments: if attachments related to exported records should be included in the export.

  • Updatable: if the exported records should be able to be updated during a module update.

If necessary, edit the Domain to determine which of the model’s records should be exported. To do so, click the Edit Domain button or (Modify filter) then Edit Domain, as appropriate. Proceed to make any required changes.

After configuring a model for export, click Studio Export to return to the main screen. To download a ZIP file with the customizations for all the listed models, click Export.

Notă

It is not necessary to select one or more models as all listed models will be included in the export. To remove a model from the export, select it and click the Actions button then Delete.

In the Studio Export window:

  • leave the checkboxes unticked to export only the customizations done with Studio.

  • tick Include Data to include data from the selected models in the export.

  • tick Include Demo Data to include data from the selected models that is flagged as demo data. Ticking this option also ticks Include Data.

Click the Export button to download the ZIP file.

Choosing to export both data and demo data

Import customizations

Atenționare

Before importing, make sure the destination database is on the same Odoo version and contains the same apps and modules as the source database. Studio does not add the underlying modules as dependencies of the exported module.

To import and install Studio customizations in another Odoo database:

  1. Connect to the destination database.

  2. Click the (Toggle Studio) button on the main Odoo dashboard, then Import.

  3. Upload the exported ZIP file. If demo data should be imported, tick Load demo data.

  4. Click Install.