copyWith method
OdooView
copyWith({
- String? id,
- String? name,
- String? model,
- ViewType? viewType,
- String? docModule,
- String? inheritId,
- List<
OdooField> ? topLevelFields, - List<
OdooField> ? fields, - List<
OdooGroup> ? groups, - List<
NotebookPage> ? pages, - bool? createButton,
- bool? deleteButton,
- bool? editButton,
- String? customCSS,
- bool? editable,
- bool? editableTree,
- String? defaultOrder,
- bool? noCreate,
- String? kanbanClass,
- bool? quickCreate,
- String? groupBy,
- int? priority,
Implementation
OdooView copyWith({
String? id,
String? name,
String? model,
ViewType? viewType,
String? docModule,
String? inheritId,
// Accept both 'topLevelFields' and the shorter 'fields' alias
List<OdooField>? topLevelFields,
List<OdooField>? fields, // alias for topLevelFields
List<OdooGroup>? groups,
List<NotebookPage>? pages,
bool? createButton,
bool? deleteButton,
bool? editButton,
String? customCSS,
bool? editable,
bool? editableTree, // alias for editable (tree-view compat)
String? defaultOrder,
bool? noCreate,
String? kanbanClass,
bool? quickCreate,
String? groupBy,
int? priority,
}) {
return OdooView(
id: id ?? this.id,
name: name ?? this.name,
model: model ?? this.model,
viewType: viewType ?? this.viewType,
docModule: docModule ?? this.docModule,
inheritId: inheritId ?? this.inheritId,
topLevelFields: fields ?? topLevelFields ?? this.topLevelFields,
groups: groups ?? this.groups,
pages: pages ?? this.pages,
createButton: createButton ?? this.createButton,
deleteButton: deleteButton ?? this.deleteButton,
editButton: editButton ?? this.editButton,
customCSS: customCSS ?? this.customCSS,
editable: editableTree ?? editable ?? this.editable,
defaultOrder: defaultOrder ?? this.defaultOrder,
noCreate: noCreate ?? this.noCreate,
kanbanClass: kanbanClass ?? this.kanbanClass,
quickCreate: quickCreate ?? this.quickCreate,
groupBy: groupBy ?? this.groupBy,
priority: priority ?? this.priority,
createdAt: createdAt,
updatedAt: DateTime.now(),
);
}