Around a record
A record sheet sits in more than its card. Over it, Flectra's control panel: the breadcrumbs back to the list, the gear menu, and the pager — “3 / 42”. Beside it, the record's main attachment and its conversation. The page says what the menu holds; your app gives the records round this one and the trail to it.
The Vendor bill demo, in each framework, shows all of it.
The sheet's toolbar
{
"type": "sheet", "id": "sheet",
"toolbar": {
"menu": [
{ "id": "m-print", "label": "Invoice", "group": "print", "action": "print_invoice" },
{ "id": "m-debit", "label": "Debit Note", "action": "action_debit_note", "invisible": "state != 'posted'" },
{ "id": "m-archive", "builtin": "archive" },
{ "id": "m-unarchive", "builtin": "unarchive" },
{ "id": "m-duplicate", "builtin": "duplicate" },
{ "id": "m-delete", "builtin": "delete", "roles": ["account.group_account_manager"] }
],
"pager": true,
"breadcrumbs": true
},
"children": []
}
Each item of menu is pressed like a button: its steps, then its action, asking its confirm first; it shows by invisible and roles. "group": "print" puts it under Print, as Flectra's reports. A builtin item needs no words or steps of its own:
| Built-in | What it does |
|---|---|
archive · unarchive | Asks first, then archives through your data source's archive, or your app's action archive; the record is loaded again. Archive shows while the record's active is not false, Unarchive while it is. |
duplicate | Saves what changed, copies the record through copy — or your action duplicate, answering with the copy's record — and shows the copy: every value but those a copy does not keep. |
delete | Asks first, then deletes through delete, or your action delete. The pager moves to the next record; with none left, the breadcrumbs go back; else the form starts a new one. |
print | Under Print, as This record (This invoice where the page names its records): the record on paper, alone, as the page prints. |
A line between items is { "type": "divider", "id": "m-rule" }, left out where nothing shows on one side of it. An item with a menu of its own opens it beside it, shown with ›: pointed at, pressed, or with Enter, Space or → (← right to left); ← and Escape close it. With menuFrom, your app gives more items as the menu opens — a bug's templates, which depend on the bug — through its onAction, asked with that action's name, the item's params, the record and its values, and answering { menu: [...] }; each runs its steps, then its action, asking its confirm first. An item whose menu has nothing to show is not shown. A button's own menu takes both too.
{ "id": "m-templates", "label": "Templates", "menuFrom": "templates",
"menu": [{ "id": "m-capture", "label": "Capture…", "action": "capture-template" }, { "id": "m-rule-t", "type": "divider" }] }
Give a built-in steps of its own and they run instead, without its question: Flectra's employee form, whose Archive opens the departure wizard, is { "id": "m-archive", "builtin": "archive", "steps": [{ "do": "open", "page": "hr-departure-wizard", "record": "id" }] }. The same steps — archive, unarchive, duplicate, delete — run from any button or moment, as Actions says.
Where the record's data source says the person may not archive, duplicate or delete it (can, see what this person may do), those items are not in the menu, nor the buttons whose steps would do it; the menu's foot says why, and the steps refuse if run from elsewhere.
What a copy keeps
Duplicate copies every value but a field's that says "copy": false, as Odoo's copy=False: the copy starts it as a new record does — its default, or what its defaultFrom works out — else empty. A posted bill's copy is a draft to change and confirm on its own, never a second posted bill:
"state": {
"type": "selection", "label": "Status",
"options": [{ "value": "draft", "label": "Draft" }, { "value": "posted", "label": "Posted" }],
"default": "draft",
"copy": false
}
Your data source makes the copy and applies it: its copy is given the page's fields, and the copy it answers with is shown as it is — Fieldia writes nothing to it after. The memory source applies it; an Odoo or Flectra server applies its own copy=False. On a table's line field, a line's own copy (its ⧉, a card's Copy) starts the field as a new line does, the record's lineDefaults too, and the memory source's copy of a record does the same in each of its lines; a table that says "copy": false is copied with no lines. A field is copied unless it says false — a status bar's field too; the designer's Copied with the record starts off for a status it adds. copy came in format 0.14: a page that uses it says "fieldia": "0.14", which stampPage writes.
A work item's head
A sheet's head draws the record as a work tracker draws a bug: its kind's strip of colour along the start edge and a badge — the kind's icon, its name in capitals, the record's number — over the title; the number before the title, with Copy title at its end while it is pointed at or focused — a long title wrapping onto more lines where it is too long for its line, read from its start and never cut, its words whole — only a word longer than the line, a web address, is broken — one line all the same (Enter adds none); a row of people and counts under it, the record's buttons at its end; then a band of fields, their labels beside them, “Updated by” and the tabs at its end. The classic header bar, statusbar, badges and stat buttons give way to it; the gear menu is its ⋮.
{
"type": "sheet", "id": "bug",
"title": { "field": "title", "before": [{ "type": "field", "id": "t-number", "field": "number" }] },
"head": {
"kind": { "field": "work_type", "numberField": "number",
"looks": { "bug": { "colour": "#cc293d", "icon": "bug" }, "task": { "colour": "#f2cb1d", "icon": "task" } } },
"meta": [
{ "type": "field", "id": "h-assigned", "field": "assigned_to", "placeholder": "No one selected" },
{ "type": "link", "id": "h-comments", "icon": "chat", "field": "comment_count",
"words": { "one": "Comment", "other": "Comments" }, "target": "g-discussion" }
],
"actions": [
{ "type": "button", "id": "b-save-close", "label": "Save and Close", "icon": "save", "primaryWhenChanged": true,
"steps": [{ "do": "save" }, { "do": "close" }], "menu": [{ "id": "m-save", "label": "Save", "steps": [{ "do": "save" }] }] },
{ "type": "button", "id": "b-follow", "label": "Follow", "pressedLabel": "Following", "pressed": "following",
"icon": "eye", "action": "follow", "menuIcon": "gear", "menuLabel": "Notification settings",
"menu": [{ "id": "m-all", "label": "All changes", "action": "follow-all" }] },
{ "type": "button", "id": "b-undo", "label": "Revert changes", "icon": "undo", "iconOnly": true, "steps": [{ "do": "reset" }] }
],
"band": { "tracks": ["274px", "1fr"], "labelWidth": 76, "children": [
{ "type": "field", "id": "f-state", "field": "state", "widget": "dot", "hotkey": "e" },
{ "type": "field", "id": "f-reason", "field": "reason", "readonly": true, "readonlyReason": "Set by the workflow" }
] },
"updated": { "byField": "changed_by", "atField": "changed_date", "opens": "t-history" }
},
"children": [{ "type": "tabs", "id": "tabs", "place": "head", "children": [
{ "type": "tab", "id": "t-details", "label": "Details", "children": [] },
{ "type": "tab", "id": "t-history", "label": "History", "icon": "history", "iconOnly": true, "children": [] },
{ "type": "tab", "id": "t-links", "label": "Links", "icon": "link", "iconOnly": true, "count": "related", "children": [] }
] }]
}
- Tags in the row — a
many2manydrawn as tags, with"adder": "button"or its box — sit inline after the comments' link, what adds one after the last chip; out of room, the chips wrap in a slot of their own and the row's other parts keep its first line. - A button takes
iconOnly(its label its name and tooltip),pressedwithpressedLabelfor a toggle,menufor a split button — or a menu button with no steps of its own — andprimaryWhenChanged: quiet but usable with nothing changed, when Save and Close simply closes. Undo with nothing to put back says “Nothing has changed.” - Your app answers Follow with
{ stored: { following: true } }: values the server keeps, written as loaded ones are, never a change to save —form.setValues(values, { stored: true })does the same. - A field's
hotkeyunderlines that letter of its label; Alt with it takes the focus there. The page's"lockAt": "value"puts a locked field's lock at its value's start. "place": "head"puts the sheet's tabs at the band's end, their panels as the body; a tab'scountshows in a pill and in its name, “Links, 0” — a field's, or the records of a related list in the tab ({ "related": "links" }, below).- In
openFormDialog({ size: 'inset', backdrop: 'clear', maximise: true, resizable: true })the head is the dialog's own: no title bar or foot, its ⤢ and × at the badge row's end, Escape and × asking before changes go.
The pager and the breadcrumbs: your app's
const viewer = mountViewer(host, {
page, dataSource, recordId: 7,
// The list it was opened from: their ids in order…
records: [3, 7, 12, 19],
// …or how many there are, where this one is, and the id at a place.
// records: { total: 42, at: 2, id: (at) => api.idAt(at) },
breadcrumbs: [{ label: 'Vendor bills', open: () => router.back() }],
});
viewer.on('open', ({ recordId }) => router.replace(`/bills/${recordId}`));
The pager says where the record is, “2 / 4”, and goes round from the last to the first. Moving saves what changed first, as Flectra does; a refused save keeps the record. Alt+P and Alt+N press its buttons. A copy joins the records after the one it was made from; a deleted record leaves them. The form shows the other record in place — form.openRecord(id) — and its open event says which: in React onRecord, in Vue @record, in Angular (record), beside onArchive, onDuplicate and onDelete.
The breadcrumbs are a nav: each page before the record a link — href or open — and the record last, by its title field, with aria-current="page". A page a step opens in the record's place adds the record to the trail, as the way back. "pager": false or "breadcrumbs": false keeps them away even when your app gives them.
In a dialog there is no pager and no trail: they belong to the record under it. The gear menu still shows. On a phone the gear keeps only its picture and the trail folds to the page before this one, an arrow back.
Related records inside it
A customer's invoices, a property's viewings, an employee's leave requests: another model's records that point at this one, listed inside it — in a group, a tab, or straight in the sheet — a page at a time, searched, sorted and counted.
{
"type": "related", "id": "invoices", "title": "Invoices",
"model": "invoice", "field": "partner_id",
"fields": {
"name": { "type": "char", "label": "Number" },
"invoice_date": { "type": "date", "label": "Invoice date" },
"state": { "type": "selection", "label": "Status",
"options": [{ "value": "sent", "label": "Sent" }, { "value": "paid", "label": "Paid" }] },
"currency_id": { "type": "many2one", "label": "Currency", "relation": "currency" },
"amount": { "type": "monetary", "label": "Amount", "currencyField": "currency_id" }
},
"columns": ["name", "invoice_date", "state", "amount"],
"cells": { "state": { "widget": "dot", "options": { "tones": { "paid": "success" } } }, "amount": { "total": "sum" } },
"filter": [{ "field": "company_id", "op": "=", "valueFrom": "company_id" }],
"sort": [{ "field": "invoice_date", "desc": true }],
"limit": 5,
"viewAll": { "page": "invoices", "as": "page" }
}
- Its records are those of
modelwhosefield— their link to this record — is this record, and thatfilterlets through, avalueFromread from this record. Your data source'slistanswers, with{ field: "partner_id", op: "=", value: 1 }first among its conditions: nothing new to write. Withoutlist, the part is not shown. - Its columns are fields of its own
fields— text, numbers, money, yes or no, dates, choices and links — drawn by the list's own table: a state's dot, a phone as people read it, a column's total under it (with your source'stotals). - On a phone, with
card, its rows are cards, as a list's are ("card": { "title": "name", "status": "state", "fields": ["amount"] },{}for the columns'): a title, a status pill in its column's tones, a few lines, each a field of its ownfields; a card is its row, pressed to open its record. On paper its rows as shown, a table, and how many of how many where they run past a page: "5 of 23". - Its rows' own rules:
rowTones,rowBoldandrowButtons, as a list's, each read on the row's own record — its fields,id,userandcontext, never this record's — a row's button run with that one record (recordIds) while this record is shown, then its records asked again: an overdue invoice in red, Send a reminder on one sent. - A page at a time:
limitrows, 5 unless said. Its title says how many there are; past a page, a pager and a search box show, and its headers put it in order. - A row opens its record in a dialog, with the page your app's
pagesgives formodel; New opens a new one there, itsfieldfilled in with this record, and lists it once saved. Where your app gives no page for the model, neither is offered;"create": falseoffers no New. - Your app's own way, with
"open": "app": a row and New go through youronOpenfirst (or your host'sopen), as View all does —{ page: 'quotation', as: 'dialog', recordId: 7 }for a row,{ page: 'quotation', as: 'dialog', recordId: null, values: { partner_id: { id: 1, label: 'Nile Traders' } } }for New, this record filled in through the values —pagebeing the id of the page your app gives for the model, else the model's name. Answer with how it ended (your router's page: a promise that never settles), orundefinedfor the dialog after all; the list asks for its records again once it settles. Rows and New are offered where your app gives a page for the model or a way of its own. - View all opens the page
viewAllnames — your app's list of those records — showing this record's alone: in a dialog, a side panel ("as": "panel") or this page's place ("as": "page"), or your own way, throughonOpen, whose request carries the conditions asfilterfor your router. Its list says what it is kept to as chips over it — Customer: Nile Traders — which a person may take away for every record; your route hands them on fromrequest.searchas the list'slistSearch. - Before the record's first save nothing points at it: the part says so, with no New.
- Another record shown — the pager, a reload, Discard — its records are asked again; an answer for the one before is drawn in none.
- Counted on its tab: a tab holding it may count its records,
"count": { "related": "quotations" }by its id — “Quotations 4”, read out “Quotations, 4”. Your source'slistis asked for one record, with the list's own conditions, as the record is shown, whether the tab is open or not, and the count is itstotal; the list's own count after New, a delete or a row's button stands for it then. None is shown until it is known: before the answer, before the record's first save, while the list is hidden.
In the designer, a Related list is among the toolbox's records on a record's page: its panel sets its title, the model and link, its columns, its cards on a phone, its rows a page, New, where rows and New open, and View all; a tab's Count from offers the related lists in it. Try a customer with its invoices and quotations, or a property with its viewings.
The attachment beside the sheet
{ "type": "sheet", "id": "sheet", "attachmentPreview": {}, "children": [] }
Flectra's o_attachment_preview: the record's main attachment, a PDF in the browser's own viewer or a picture, beside the sheet on a wide form and under it on a narrow one, with Previous and Next through several and Open. { "field": "invoice_pdf" } shows a file field's file; left out, the record's attachments come from your data source's attachments — asked again when the form shows another record, and after a save. It hides while there is nothing to show. With the conversation's own files:
import { chatterAttachments } from '@fieldia/chatter';
mountViewer(host, { page, dataSource: { ...dataSource, attachments: chatterAttachments(source) } });
On paper
Every page prints — Ctrl+P, the browser's menu, or the page's own Print — as a clean page: every tab one after another under its name, every wizard step and folded group open (but what a condition hides); no buttons, bars, gear, pager, a tab's count or help; each box written as the words a person reads in it — a choice by its label, a link by its name, money with its currency, a date on the page's clock, a work item's title — wrapping rather than cut; a table of lines whole, broken between its lines with its header again on each sheet, a grid's every line and column in the order the person sees them; groups side by side as the page sets them, a sheet breaking between any two of them; nothing cut across two sheets, and no tab's name, group's title or table's header left alone at a sheet's foot — it goes on with the start of what follows it; no required star; a number, an amount, a day or a phone number in a table's cell on one line; light colours, the theme's accent kept for the headings; the page's language and direction. Over it, the record's own name — its sheet's title field, else its name, else its first line of text, on a sheet or a page of sections alike: SA-2026-014; with none yet, what the page calls its records and its stage, Invoice · Draft — and the day it was printed; with the page's print, your logo and words over it and its footer under every sheet — nothing runs under it — each {field} showing its value, and a line whose value is empty left out whole. A tab, a group, a field or a related list marked "print": false is left out, as an invoice's journal items. With a dialog or a panel open over the page, its form alone prints — what a person printing looks at — never the page behind it:
{
"print": {
"header": "Zamalek Office Supplies S.A.E.\n26 July Street, Zamalek, Cairo",
"footer": "Pay by bank transfer, quoting {name}. Thank you for your business.",
"logo": "https://example.com/logo.svg"
},
"layout": {
"type": "sheet", "id": "sheet",
"toolbar": { "menu": [
{ "id": "m-print", "builtin": "print" },
{ "id": "m-pdf", "label": "Invoice", "group": "print", "action": "print_invoice" }
] },
"children": [
{ "type": "tabs", "id": "notebook", "children": [
{ "type": "tab", "id": "lines", "label": "Invoice Lines", "children": [] },
{ "type": "tab", "id": "journal", "label": "Journal Items", "print": false, "children": [] }
] }
]
}
}
The built-in print item, under Print as This record — or a { "do": "print" } step, or viewer.print() — prints the record alone, the page round it in your app left out. An item under Print may run your action instead; answer it with the file your server made, and it opens over the record in the browser's own PDF viewer, with Download — or is saved, with show: "download":
onAction: async ({ action, recordId }) => {
if (action !== 'print_invoice') return;
const answer = await fetch(`/report/invoice/${recordId}.pdf`);
return { file: { name: 'INV_2026_0042.pdf', type: 'application/pdf', bytes: await answer.blob() } };
}
file takes your server's url, its data as base64, or its bytes. What a stylesheet cannot do (drawing a tab never opened, writing a box's words, measuring the room a heading keeps under it for the start of what follows) is done at the window's beforeprint and undone at afterprint. Print an invoice, or a list of them.
All of it comes in a part of its own — fieldia.print.js, 5 KB gzipped, a chunk of its own in your app's bundle — only as a person means to print, so a page no one prints never loads it. Ctrl+P (⌘P) is Fieldia's: held back the first time while the part comes, then the page laid out whole and the browser's print asked. Every Print waits for it. It is fetched, and nothing printed, as the gear opens with Print in it or a pointer rests on a Print button, and once a page meant for paper is drawn — its own print words, a list's "print": true — when the browser is idle. The browser's own menu is the one print no page can hold back: before the part came, it prints a plain look — the page as the screen shows it, without buttons, bars or hints, in light colours — and asks for the part, so every print after is whole. To have the whole look from the first moment, printPart.load() as your app starts.
The chatter beside it
As Flectra's chatter, the side panel sits beside the sheet on a form 1534px wide or more, the page growing by its width so the sheet keeps its own; on a narrower one it goes under the sheet, which takes the whole width. "sidePanelBeside": "always" keeps it beside, narrower, down to 600px, the sheet's columns stacking inside it as they need. A grid of many columns beside it can "fit": "shrink": its columns go narrower, their headers wrapping, before it scrolls.
A post step puts words in the record's conversation — { "do": "post", "message": "Lost: {lost_reason}" }, a note unless "kind": "message" — and so does your app's answer, { post: "Debit note DN/0001 made" }. In a page opened over the record, such as the Mark as Lost wizard, it posts in the record's conversation. The chatter fetches again after a save and after the record is loaded again, so what your server posts — tracked changes, a server action's note — shows.
Flectra's own form controllers
Flectra pages with a js_class (account_move_form, crm_form, hr_employee_form…) carry JavaScript of their own. Fieldia does not copy them; what they did is data here, or your app's:
- An Archive that opens a wizard (hr_employee_form): a built-in item with its own steps.
- A probability that follows the stage, a won stage (crm_form): your data source's
onchangeand your server's. - Quick edit of an invoice (account_move_form): the form is editable as it is; a lock by state is
readonlyon the sheet's parts. - Anything else at a moment: the page's
onsteps, and acallof your app's action, whose answer can set values, post, reload, open a page or show another record.