widget | Class | 字段类型 | 适用 字段 | 选项 / 属性 | 效果 | 说明 |
|
|
|
|
|
|
|
ace | AceEditor | 基本 | char text | options: 'mode': 'xml' | 'python'
Eg: options="{'mode': 'python'}" |
|
|
attachment_image | AttachmentImage | 关系 | many2one |
|
|
|
barcode_handler | FormViewBarcodeHandler | 特殊 |
|
|
|
|
binary | FieldBinaryFile | 基本 | binary | attributes: filename
eg <field name="datas" filename="datas_fname"/>
|
|
|
boolean | FieldBoolean | 基本 |
|
|
|
|
boolean_button | FieldBooleanButton | 基本 | boolean |
options: terminology
eg: options={ "terminology": "archive"|"active" |"close" }
或者 options={ "terminology": { "string_true": 真时显示字符串 "string_false": 假时显示字符串 "hover_true": 真时提示 "hover_false": 假时提示 } }
|
|
|
boolean_favorite | FavoriteWidget | 基本 | boolean |
|
|
|
boolean_toggle | BooleanToggle | 基本 | boolean |
|
|
|
bullet_state | SetBulletStatus | 关系 | selection |
|
|
|
button |
| 基本 |
|
|
|
|
char | FieldChar | 基本 | char |
|
|
|
char_domain |
| 基本 |
|
|
|
|
checkbox |
| 基本 |
|
|
|
|
CopyClipboardChar |
| 特殊 |
|
|
|
|
dashboard_graph |
| 特殊 |
|
|
|
|
date | FieldDate | 基本 | date datetime | options: datepicker
<field name="datefield" options='{"datepicker": {"daysOfWeekDisabled": [0, 6]}}'/>
|
|
|
datetime | FieldDateTime | 基本 | date datetime | options: datepicker
<field name="datefield" options='{"datepicker": {"daysOfWeekDisabled": [0, 6]}}'/> |
|
|
deprec_lines_toggler |
| 特殊 |
|
|
|
|
domain | FieldDomain | 基本 | char |
options: in_dialog fs_filters model
Eg: options="{'model': 'model_name', 'in_dialog': True}" |
|
|
FieldEmail | 基本 | char |
|
|
| |
field_float_scannable | FieldFloatScannable | 特殊 |
|
|
|
|
float | FieldFloat | 基本 | float | options:
attributes: digits
eg: <field name="factor" digits="[42,5]"/>
|
|
|
float_factor | FieldFloatFactor | 基本 | float |
options: factor
default: factor =1.0 |
|
|
float_time | FieldFloatTime | 基本 | float |
|
|
|
float_toggle | FieldFloatTogglenn | 基本 | float | options: digits factor range
default: factor =1.0 range = [0.0, 0.5, 1.0]
|
|
|
gauge | GaugeWidget | 基本 | float |
options: max_value max_field label label_field title gauge_value_field style target_goal definition_suffix
Eg: options="{'max_field': 'target_goal', 'label_field': 'definition_suffix', 'style': 'width:160px; height: 120px;'}"
|
|
|
handle | HandleWidget | 基本 | integer | options:
attributes:
|
|
|
hr_attendance_form_presence_indicator |
| 基本 | boolean |
|
|
|
hr_attendance_kanban_presence_indicator |
| 基本 | boolean |
|
|
|
hr_org_chart |
| 基本 |
|
|
|
|
html | FieldTextHtmlSimple | 基本 | html | options: style-inline
Eg: options="{'style-inline': true}" |
|
|
html_frame | FieldTextHtml | 基本 | html | options: editor_url
Eg: options="{'editor_url': '/mass_mailing/field/email_template'}" |
|
|
id |
| 基本 | integer |
|
|
|
image | FieldBinaryImage | 基本 | binary | options: preview_image size
Eg: options="{'preview_image': 'image_medium', 'size': [90, 90]}"
|
|
|
image_selection | ImageSelection | 基本 | selection | options: background boxed |
|
|
input |
| 基本 | InputField |
isPassword
eg: options = "{ 'isPassword': True} " 或者 在 attributes 写 'password' = True
|
|
|
integer |
| 基本 |
|
|
|
|
iot | IotFieldFloat | 特殊 | float |
|
| v12 |
kanban_activity | KanbanActivity | 特殊 |
|
|
| v11 |
kanban_label_selection |
| 关系 | selection | options: classes
Eg: options="{'classes': {'draft': 'primary', 'open': 'success', 'close': 'default'}}" |
|
|
kanban_state_selection | StateSelectionWidget | 关系 | selection |
|
|
|
label_selection | LabelSelection | 关系 | selection | options: classes
eg <field name="state" widget="label_selection" options="{
|
|
|
link_button | LinkButton | 基本 | char |
|
|
|
mail_activity | Activity | 特殊 |
|
|
| v11 |
mail_followers | Followers | 特殊 |
|
|
|
|
mail_thread | ThreadField | 特殊 |
| options: post_refresh display_log_button
Eg: options="{'post_refresh': 'recipients'}" |
|
|
many2many | FieldMany2Many
| 关系 | many2many | options: create_text
attributes: mode domain
|
|
|
many2many_binary | FieldMany2ManyBinaryMultiFiles | 关系 | many2many | options: color_field
eg <field name="category_id" widget="many2many_tags" options="{'color_field': 'color'}"/>
|
|
|
many2many_checkboxes | FieldMany2ManyCheckBoxes | 关系 | many2many |
|
|
|
many2many_kanban |
| 关系 | many2many |
|
|
|
many2many_tags | FieldMany2ManyTags | 关系 | many2many | options: color_field
Eg: options="{'color_field': 'color'}" |
|
|
many2many_tags_email | FieldMany2ManyTagsEmail | 关系 |
|
|
|
|
many2manyattendee | Many2ManyAttendee | 关系 |
|
|
|
|
many2one | FieldMany2One | 关系 | many2one | options: no_open no_create no_create_edit quick_create
create_name_field always_reload
attributes: can_create can_write
eg <field name="currency_id" options="{'no_create': True, 'no_open': True}"/>
|
|
|
monetary | FieldMonetary | 基本 | monetary float | options: currency_field field_digits
eg <field name="value" widget="monetary" options="{'currency_field': 'currency_id'}"/>
atrributes:
|
|
|
mrp_time_counter |
| 特殊 |
|
|
|
|
one2many | FieldOne2Many | 关系 | one2many | options: reload_whole_on_button create_text |
|
|
one2many_list | FieldOne2Many | 关系 | one2many |
|
|
|
pad | FieldPad | 特殊 |
|
|
|
|
payment | ShowPaymentLineWidget | 特殊 |
|
|
|
|
pdf_viewer |
| 特殊 |
|
|
|
|
percentpie | FieldPercentPie | 基本 | float |
|
|
|
phone | FieldPhone | 基本 | char |
|
|
|
previous_order | LunchPreviousOrdersWidget | 关系 | one2many |
|
|
|
priority | PriorityWidget | 关系 | selection |
|
|
|
progressbar | FieldProgressBar | 基本 | integer float | options: current_value max_value editable edit_max_value title
Eg: options="{'current_value': 'absence_of_today', 'max_value': 'total_employee', 'editable': false}" |
|
|
radio | FieldRadio | 关系 | selection many2one | options: horizontal
eg <field name="recommended_activity_type_id" widget="radio"
|
|
|
reference | FieldReference | 关系 | char reference |
|
|
|
report_layout | FieldReportLayout | 关系 | many2one selection |
|
|
|
section_and_note_one2many | SectionAndNoteFieldOne2Many | 特殊 |
|
|
| v12 |
section_and_note_text | SectionAndNoteFieldOne2Many | 特殊 | text char |
|
| v12 |
selection | FieldSelection | 关系 | selection many2one | attributes: placeholder
eg <field name="tax_id" widget="selection" placeholder="Select a tax"/>
|
|
|
selection_badge | FieldSelectionBadge | 关系 | selection many2one |
|
|
|
sms_widget | SmsWidget | 特殊 |
|
|
|
|
stat_info | StatInfo | 基本 | integer float | options: label_field
|
|
|
state_selection | StateSelectionWidget | 关系 | selection |
|
|
|
statusbar | FieldStatus | 关系 | selection many2one | options: clickable fold_field
Eg: options="{'fold_field': 'fold'} |
|
|
text | FieldText | 基本 | text |
|
|
|
timesheet_uom | FieldTimesheetFactor | 特殊 |
|
|
|
|
timezone_mismatch | FieldTimezoneMismatch | 特殊 |
| options: tz_offset_field
Eg: options="{'tz_offset_field': 'tz_offset'}" |
|
|
toggle_button | FieldToggleBoolean | 基本 | boolean | options: active inactive
Eg: options='{"active": "Reported in last payslips", "inactive": "To Report in Payslip"}' |
|
|
upgrade_boolean | UpgradeBoolean | 特殊 |
|
|
|
|
upgrade_radio | UpgradeRadio | 特殊 |
|
|
|
|
url | UrlWidget | 基本 | char | options:
attributes: text
eg <field name="foo" widget="url" text="Some URL"/>
|
|
|
website_button | WidgetWebsiteButton | 特殊 |
|
|
|
|
odoo widget
10.0 技术