copyWith method

OdooView copyWith({
  1. String? id,
  2. String? name,
  3. String? model,
  4. ViewType? viewType,
  5. String? docModule,
  6. String? inheritId,
  7. List<OdooField>? topLevelFields,
  8. List<OdooField>? fields,
  9. List<OdooGroup>? groups,
  10. List<NotebookPage>? pages,
  11. bool? createButton,
  12. bool? deleteButton,
  13. bool? editButton,
  14. String? customCSS,
  15. bool? editable,
  16. bool? editableTree,
  17. String? defaultOrder,
  18. bool? noCreate,
  19. String? kanbanClass,
  20. bool? quickCreate,
  21. String? groupBy,
  22. 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(),
  );
}