- The version of 'jQuery' is now "3.6.0" (jQuery-migrate 3.3.2).
Migration warning are enabled and documented here https://github.com/jquery/jquery-migrate/blob/main/warnings.md,
and you should read the migration guides:
- https://jquery.com/upgrade-guide/3.0/
- https://jquery.com/upgrade-guide/3.5/
- jQuery 3.6.0 needed the update of the following dependencies :
- The version of 'fullcalendar' is now "3.10.2".
- The version of 'floatthead' is now "2.2.1".
Non breaking changes :
----------------------
Deprecations :
- The loading of settings from "creme/local_settings.py" & "creme/project_settings.py" is deprecated ;
use the new project layout & the arguments "--settings" of the executable "creme".
- The folders "creme/media/upload" & "creme/media/static" are deprecated ;
use "my_project/media/upload" & "my_project/media/static" instead.
- The file "creme/django.wsgi" is deprecated ; use "my_project/wsgi.py" instead.
- The class 'creme_core.forms.fields.AjaxModelChoiceField' is deprecated.
- In 'creme_core.models' :
- The method 'CremePropertyType.create()' is deprecated ; use 'CremePropertyType.objects.smart_update_or_create()' instead.
- The method 'Job.not_finished_jobs()' is deprecated ; use 'Job.objects.not_finished()' instead.
- In 'fields_config' :
- The method 'FieldsConfigManager.is_model_valid()' is deprecated ; use 'has_configurable_fields()' instead.
- In 'FieldsConfig.LocalCache', the methods 'get_4_model()' & 'get_4_models()' are deprecated ;
use 'get_for_model()' & 'get_for_models()' instead.
- In 'history', all code related to history line rendering is deprecated ;
use the new rendering system 'creme_core.gui.history' instead.
- The method 'RelationType.create()' is deprecated ; use 'RelationType.objects.smart_update_or_create()' instead.
- The method 'Vat.get_default_vat()' is deprecated ; use 'Vat.objects.default()' instead.
- In 'creme_core.templatetags' :
- In 'creme_widgets', the templatetag '{% widget_select_or_msg %}' & its template file are deprecated ;
use '{% widget_enumerator %}' instead.
- In 'history', the template filter "|history_modifications" is deprecated.
- In Javascript :
- Some creme.ajax.* functions are now deprecated; use 'creme.ajax.Query' instead :
- creme.ajax.ajax()
- creme.ajax.get()
- creme.ajax.post()
- creme.ajax.submit()
- creme.ajax.reloadContent()
- creme.ajax.json.send()
- creme.ajax.json.get()
- creme.ajax.json.post()
- creme.ajax.json.isvalid()
- creme.ajax.json.parse()
- Some creme.form.* functions are now deprecated :
- creme.forms.Select.optionsFromData()
- creme.forms.Select.fill()
- All 'creme.layout.Layout' classes are deprecated; use CSS instead :
- creme.layout.Layout
- creme.layout.ColumnSortLayout
- creme.layout.CSSColumnLayout
- creme.layout.SortLayout
- The jquery extension '$.browserVersion' is now deprecated but kept as gccolor dependency.
- jQuery 3.x :
- $.bind() is deprecated; use $.on() instead.
- $.unbind() is deprecated; use $.off() instead.
- $.trim() is deprecated; use String.prototype.trim() instead.
- $.isArray() is deprecated; use Array.isArray() instead.
- Use properties instead of attributes for disabled state :
- $.removeAttr('disabled') => $.prop('disabled', false)
- $.attr('disabled', 'disabled') => $.prop('disabled', true)
- 'click' trigger & handler shortcuts are deprecated :
- $.click() => $.trigger('click')
- $.click(handler) => $.trigger('click', handler)
- 'submit' trigger & handler shortcuts are deprecated :
- $.submit() => $.submit('click')
- $.submit(handler) => $.submit('click', handler)
- 'change' trigger & handler shortcuts are deprecated :
- $.change() => $.trigger('change')
- $.change(handler) => $.trigger('change', handler)
- 'hover' event is deprecated; use 'mouseenter' & 'mouseleave' instead :
- $.hover(onenter, onleave) => $.on('mouseenter', onenter).on('mouseleave', onleave)
- Apps :
* Persons :
- The function 'forms.base._get_address_field_names()' is deprecated.
- The class 'forms.address._AuxiliaryAddressForm' is deprecated.
* Commercial :
- The method 'AbstractStrategy.get_segment_category()' is deprecated.
* Reports :
- The template file "reports/templatetags/report_chart.html" is deprecated.
* Recurrents :
- The property 'registry.RecurrentRegistry.ctypes' is deprecated ; use "models" instead.
* Crudity :
- The function 'crudity.utils.strip_html()' is deprecated ;
use 'creme_core.utils.html.strip_html()' instead.
In 'creme_core.views.generic', in the view-classes 'CremeModelCreation' & 'CremeModelEdition',
the redirection URL can be passed in the GET request (argument "callback_url").
Some views have been reworked to use this feature instead of using a fixed URL.
Apps :
* Reports :
- The template file "templates/reports/view_graph.html" use smaller '{% block %}' tags to be easier to extend.
Breaking changes :
------------------
Deprecated stuffs which have been removed :
- In 'creme_core.models' :
- The method 'Relation._build_symmetric_relation()' has been removed.
- These methods of 'EntityFilter' have been removed : create(), get_latest_version(), get_for_user()
- These methods of 'HeaderFilter' have been removed : create(), get_for_user()
- These methods of 'FieldsConfig' have been removed :
create(), field_enumerator(), filter_cells(), get_4_model(), get_4_models(), is_model_valid()
- These methods of 'CustomField' have been removed : get_pretty_value(), get_value_class(), type_verbose_name()
- The method 'CustomFieldValue.delete_all()' has been removed.
- The method 'ButtonMenuItem.create_if_needed()' has been removed.
- The property 'BrickHomeLocation.brick_verbose_name' has been removed.
- The property 'BrickMypageLocation.brick_verbose_name' has been removed.
- The method 'CustomBrickConfigItem.generate_id()' has been removed.
- The property 'InstanceBrickConfigItem.errors' has been removed.
- These methods of 'SearchConfigItem' have been removed : create_if_needed(), get_4_models()
- In 'backends._BackendRegistry' :
- The property 'backends' has been removed.
- The method 'get_backend()' has been removed.
- In 'gui' :
- In 'field_printers' :
- The class 'M2MPrinter' has been removed.
- These functions have been removed : print_decimal(), print_integer()
- These methods of 'quick_forms.QuickFormsRegistry' have been moved : iter_models(), get_form()
- In 'forms' :
- In 'fields', these classes have been removed: AjaxChoiceField, AjaxMultipleChoiceField
- The property 'header_filter.EntityCellsField.content_type' has been removed.
- The class 'widgets.DependentSelect' has been removed.
- In 'views' :
- In 'bricks', these functions have been removed :
build_context(), get_brick_ids_or_404(), render_detailview_brick(), render_home_brick(), bricks_render_info()
- The decorator 'decorators.POST_only' has been removed.
- The function 'file_handling.download_file()' has been removed.
- In 'utils', these functions have been removed :
creme_entity_content_types(), get_ct_or_404(), build_ct_choices(), entities2unicode(), related2unicode()
These templatetags of 'creme_core_tags' have been removed: {% creme_media_url %}, {% hg_info %}
- The template file "creme/creme_core/templates/creme_core/generics/blockform/content.html" have been removed
- In JavaScript :
- The module 'creme.color' has been removed.
- 'creme.dialog.ConfirmAction' has been removed (never used).
- 'creme.creme_config.FormGroupsController' is renamed as 'creme.FormGroupsController'
- jQuery 3.x :
- '$.param()' does not use 'jQuery.ajaxSettings.traditional' flag anymore. Use 'creme.ajax.param()' to keep the old behavior.
- '$.val()' returns an empty array instead of 'null' when a multi-select is empty.
- Complete refactor of progress controller of jobs :
- creme.jobs.BaseJobsMonitor:
- 'BaseJobsMonitor(url)' is replaced by 'BaseJobsMonitor({url: ..., fetchDelay: ...})'
- 'start()' has been renamed as 'fetch()'.
- 'onAllJobsFinished(handler)' is replaced by 'on("finished", handler)'.
- creme.jobs.JobsMonitor:
- 'JobsMonitor(url, element)' is replaced by JobsMonitor(element, {url: '...', fetchDelay: ...})
- creme.jobs.BrickJobsMonitor:
- BrickJobsMonitor(url, brick_id) is replaced by 'BrickJobsMonitor(brick, {url: ..., fetchDelay: ...})'
where 'brick' is a 'creme.bricks.Brick' instance.
- Apps :
* Creme_config :
- In 'forms' :
- The class user_role.UserRoleDeleteForm has been removed.
- In 'custom_fields', these classes have been removed :
CustomFieldsBaseForm, CustomFieldsCTAddForm, CustomFieldsAddForm, CustomFieldsEditForm.
- The function 'user._password_validators_help_text_html()' has been removed.
- The class 'views.search.SearchItemEdition' has been renamed "SearchConfigDeletion".
* Persons :
- The module 'views.crud_relations' has been removed.
- In 'forms.base', these constants have ben removed : _BILLING_ADDRESS_FIELD & _SHIPPING_ADDRESS_FIELD
- These template files in "creme/persons/templates/persons/" have been removed :
- frags/*
- add_*_form.html
- edit_*_form.html
- The JavaScript function 'creme.persons.copyTo()' has been removed.
* Documents :
- The method 'models.AbstractDocument.get_linkeddoc_relations()' has been removed.
- The constant 'forms.document._TITLE_MAX_LEN' has been removed.
* Activities :
- In 'forms.activity', these classes have been removed :
_ActivityForm, ActivityEditForm, _ActivityCreateForm, ActivityCreateForm, RelatedActivityCreateForm, CalendarActivityCreateForm, IndisponibilityCreateForm.
- The SettingKey 'setting_keys.form_user_messages_key', and the related constant 'SETTING_FORM_USERS_MSG' have been removed.
- In the class 'views.calendar.ActivitiesData', the method '_activity_2_dict' is not static anymore.
- These template files have been removed in "creme/activities/templates/activities/" :
- add_activity_form.html
- forms/add-activity-popup.html
- frags/activity_form_content.html
- frags/indispo_form_content.html
* Billing :
- In 'models.Base', these methods have been removed : get_source() & get_target().
- The function 'forms.base.first_managed_orga_id()' has been removed.
- In 'views' :
- The class 'base.BaseEdition' has been removed.
- The class-view 'base.RelatedBaseCreation' does not fill <initial['target']> anymore.
- These template files have been removed in "creme/billing/templates/billing/forms/" :
add.html, add-popup.html, base.html, edit.html
- The template 'templates/billing/bricks/base/lines.html' needs the variable "line_edit_form_template" to be filled
* Opportunities :
- In 'forms.opportunity', the classes 'TargetMixin' & 'EmitterMixin' have been removed.
* Commercial :
- The constants REL_SUB_SOLD_BY & REL_OBJ_SOLD_BY have been removed.
* Emails :
- These methods of 'models.EmailSending' have been removed : get_mails(), get_unsent_mails_count().
- In 'views.crudity', these functions have been removed :
set_emails_status(), spam(), validated(), waiting()
- The class attribute 'bricks.MailsHistoryBrick._RTYPE_IDS' has been removed.
* Reports :
- In 'core.graph' :
- The property 'hand.ReportGraphHand.verbose_ordinate' has been removed.
- The method 'fetcher.RegularFieldLinkedGraphFetcher.validate_fieldname()' has been removed.
- In 'models' :
- The method 'AbstractReport.get_related_fields_choices()' has been removed.
- In 'AbstractReportGraph' :
- These methods have been removed : create_instance_brick_config_item(), get_fetcher_from_instance_brick().
- The sub-class 'InstanceBrickConfigItemError' has been removed.
- In 'views' :
- The class 'report.ReportCreation' has been removed.
- In 'graph', these functions have been removed : get_available_report_graph_types(), _get_available_report_graph_types().
- The template file "creme/reports/templates/reports/add_report.html" has been removed.
- In JavaScript, the component 'creme.reports.ReportFormController' has been removed.
* Projects :
- The property 'models.AbstractProjectTask.safe_duration' has been removed.
* Recurrents :
- The method 'registry.RecurrentRegistry.get_form_of_template()' has been removed ;
use 'get_template_form_class()' instead.
The variables 'default_app_config' present in the file '__init__.py' of all apps have been removed ;
the classes inheriting 'AppConfig' got an attribute 'default = True' instead (see https://docs.djangoproject.com/en/3.2/releases/3.2/#automatic-appconfig-discovery).
In 'creme.settings', the variable 'SITE_ID' (related to the unused app "django.contrib.sites") has been removed.
In 'creme.utils.loggers' :
- The method 'CremeFormatter.formatEncodedException()' has been removed (use 'formatException()' instead).
- The method 'CompressedTimedRotatingFileHandler._next_filename()' has been removed (it was unused).
The method 'creme_core.apps.CremeAppConfig.register_menu()' has been removed ;
all apps have been reworked to use the new API (registration of entry classes in 'apps.py', base configuration of menu in 'populate.py').
The method 'get_tag()' injected in all model-fields takes now an argument named "tag" (it was named "tag_name") ;
notice that it's better to pass an enumeration value (e.g. 'FieldTag.VIEWABLE').
If you used the fields configuration on your own models (i.e. they have fields tagged as "optional"),
you must now register them in your 'apps.py' in the method 'CremeAppConfig.register_fields_config()'
(use the method 'fields_config_registry.register_models()').
In the method 'creme_core.bricks.HistoryBrick._populate_related_real_entities()', the argument "user" has been removed.
In 'creme_core.core' :
- The module 'job' has been reworked :
- It has been split in several files, so some imports may have been broken.
- The constants 'CMD_*' have been replaced by constants 'Command.{START, END, REFRESH, PING}'.
- The class '_BaseJobSchedulerQueue' :
- has been renamed 'BaseJobSchedulerQueue'.
- its class-method 'get_main_queue()' (& the related attribute '_main_queue') has been removed ;
use the function 'get_queue()' instead.
- its constructor takes an argument "setting" now.
- its method 'pong()' takes now an instance of 'job.Command'.
- The class 'JobSchedulerQueue' (which had different definitions) has been removed ;
use the function 'get_queue()' to get the concrete instance of the queue.
- In the class 'search.Searcher' :
- The attribute '_search_map' stores now 'EntityCell' instances as values.
- The method '_build_query()' takes a parameter "cells" instead of "fields".
- The method 'get_fields()' has been removed (use 'get_cells()' instead).
In 'creme_core.forms' :
- The attribute 'ActionButtonList.actions' is not a list of tuples anymore (it's a list of 'WidgetAction' instances).
- The method 'ActionButtonList._get_button_context()' has been removed.
- The inner-class 'SelectorList.Action' has been replaced by the new class 'WidgetAction' (they are globally identical, but the new constructor takes only keyword arguments).
- Remove the 'BulkFieldSelectWidget' that is no longer useful and move its role to 'creme.lv_widget.EditSelectedAction' (JS).
In 'creme_core.gui' :
- In 'bricks', the attribute 'Brick.permission' has been replaced by 'permissions' (which accepts strings sequence too).
- In 'button_menu', the attribute 'Button.permission' has been replaced by 'permissions' (which accepts strings sequence too).
- In the class 'custom_form.CustomFormDescriptor', in the methods 'build_form_class()' & 'groups()', the argument "item" cannot be 'None' anymore.
- In 'menu', the old API has been removed :
- These classes have been removed :
Item, ViewableItem, ItemList, ItemGroup, ItemSeparator, ContainerItem, LabelItem, GroupLabelItem,
URLItem, TrashItem, QuickCreationItemGroup, CreationFormsItem, LastViewedEntitiesItem, Menu
- The global instance 'creme_menu' has been removed.
- The function '_validate_id()' has been removed.
In 'creme_core.models' :
- The field 'CustomFormConfigItem.cform_id' has been replaced by the fields 'id' & 'descriptor_id'.
- The field 'DeletionCommand.json_replacers' has been transformed to a 'JSONField'.
- In 'fields_config', the method 'FieldsConfigManager.field_enumerator()' has been removed.
- In 'job' :
- The field 'Job.raw_data' has been transform into a nullable 'JSONField' named "data" ;
the property 'Job.data' has been removed since it's useless now.
- The field 'BaseJobResult.raw_messages' (& so in the concrete child models: JobResult, EntityJobResult & MassImportJobResult)
has been transform into a 'JSONField' named "messages" ;
the property 'BaseJobResult.messages' has been removed since it's useless now.
- The field 'MassImportJobResult.raw_line' has been transform into a 'JSONField' named "line" ;
the property 'MassImportJobResult.line' has been removed since it's useless now.
- The field 'Language.code' has been removed.
- In 'search' :
- The class 'SearchField' has been removed.
- In the model 'SearchConfigItem' :
- The field 'field_names' has been replaced by 'json_cells', which stores 'EntityCells' as dictionaries.
- The class attributes '_searchfields' & '_all_fields' have been removed.
- These methods have been removed: _build_searchfields(), _get_modelfields_choices(), get_modelfields_choices().
- The property 'searchfields' has been removed ; use 'cells' & 'refined_cells' instead.
In 'creme_core.utils.meta' :
- In 'ModelFieldEnumerator' :
- Two parameters of the constructor have been renamed: "deep" became "depth", "only_leafs" has been fixed to "only_leaves".
The corresponding protected attributes have been renamed too.
- The functions passed to the methods 'filter()' & 'exclude()' take now 3 arguments by keywords
(notice: "model" is new, "deep" is now "depth").
- The method '_FilterModelFieldQuery.__call__()' takes now 3 arguments by keywords (same remark).
In 'creme_core.views.generic.base' :
- The method 'CustomFormMixin.get_custom_form_class()' is not a static method anymore.
- The default value of the attribute 'PermissionsMixin.permissions' is now an empty string (instead of 'None').
The HTML/CSS for forms have been heavily reworked :
- The HTML for 'django.forms.widgets.Select' is now wrapped in a tag "<div>".
- "<div>" tags are used instead of "<table>" in the blocks.
- The HTML id "editforms" has been removed.
- The CSS class "table_detail_view" is not use anymore.
- the CSS files "creme_core/css/blocks.css" have been removed from in the setting "CREME_CORE_CSS" (they will be removed in Creme 2.4)
In Makefile, some targets have been removed :
- "karma-ci" is no longer used in circleci script.
- These commands were broken with the new project layout :
"update", "media", "test", "test-cov", "serve", "serve-jobs", "shell".
Apps :
* Creme_config :
- There are several changes about Custom-Forms :
- In the views, the argument to retrieve the instance of 'CustomFormConfigItem' has been renamed "item_id" (instead of "form_id").
- The objects injected in the template of 'bricks.CustomFormsBrick' have changed (to get several items by descriptor) ;
So 'creme_config/bricks/custom-forms.html', the related CSS classes have changed too.
In the JS class 'creme.FormGroupsController' :
- The code has been updated to retrieve the new CSS classes correctly.
- The methods '_toggleItem()', 'items()' & 'item()' have been renamed respectively '_toggleCType()', 'ctypes()' & 'ctype()'.
- In 'forms.search' :
- These classes have been removed/replaced by new ones : _SearchForm, SearchAddForm, SearchEditForm.
The related views have been updated.
* Persons :
- The method 'forms.merge._PersonMergeForm._handle_addresses()' has been removed ;
work has been split cleanly between clean & save steps (notably by the new method '_clean_addresses()').
- The field 'AbstractContact.language' has changed :
- It has been renamed "languages".
- It is no tagged as <viewable=False> any more (we did not know if we should remove this field).
- It is now editable.
- A data migration hides it (i.e. with 'FieldsConfig') in existing installations when you upgrade.
- The class 'views.organisation.OrganisationCreationBase' has been removed (merged with 'OrganisationCreation').
* Reports :
- Some constants have been replaced by 'django.db.models.*Choices' :
- An 'IntegerChoices' class for : RGT_*, GROUP_TYPES.
- An 'TextChoices' class for : RGA_*, AGGREGATOR_TYPES.
- In 'core.graph' :
- The attribute 'cell_constraint.GHCCCustomField.customfield_type' has been replaced by "customfield_types".
- The method 'aggregator.ReportGraphAggregator.aggregrate()' has been renamed "aggregate".
- Several templatetags have been renamed (for consistency) :
- 'report_chart_json' became 'reports_chart_json'.
- 'report_chart_selector' became 'reports_chart_selector'.
- 'report_chart_labels' became 'reports_chart_labels'.
* Activities :
- The class 'bricks.PastActivitiesBrick' now inherits a new base class called '_RelatedActivitiesBrick'.
- The global dictionary 'views.activity._TYPES_MAP' has been transformed in the class attribute 'ActivityCreation.allowed_activity_types'.
* Billing :
- The constants 'DISCOUNT_*' have been replaced by an 'django.db.models.IntegerChoices' : 'model.Line.Discount'.
- The class 'forms.credit_note.CreditNoteRelatedForm' has been renamed "CreditNotesRelatedForm".
* Commercial :
- In the model 'AbstractStrategy', in the methods 'get_asset_score()' & 'get_charm_score()', the argument "segment" has been renamed "segment_desc".
* Emails :
- In 'constants' :
- 'MAIL_STATUS*' have been replaced by a 'django.db.models.IntegerChoices' : 'model._Email.Status'.
- 'MAIL_SYNC_STATUSES' has been replaced 'model._Email.SYNCHRONIZATION_STATUSES'.
- In the form-class, 'forms.mail.EntityEmailForm', the field "subject" is now required.
- In 'models.sending', some constants have been replaced by 'django.db.models.IntegerChoices' :
- 'SENDING_TYPE*' by 'EmailSending.Type'.
- 'SENDING_STATE*' by 'EmailSending.State'.
* Mobile :
- The templatetags without prefix have been prefixed :
- {% prepare_fields %} => {% mobile_prepare_fields %}
- {% document_class %} => {% mobile_document_class %}
- {% activity_card %} => {% mobile_activity_card %}
- {% get_footer %} => {% mobile_footer %}
- |orga_subjects => |mobile_organisation_subjects
* Projects :
- In 'models.AbstractProjectTask' :
- The field 'order' is not 'null=True' any more.
- The <related_name> of the field 'parent_tasks' has been renamed "children" (it was "children_set").
* Geolocation :
- The inner-constants in 'models.GeoAddress' have been replaced by an 'IntegerChoices' class :
UNDEFINED, MANUAL, PARTIAL, COMPLETE, STATUS_LABELS
* Events :
- The name of the class 'bricks.ResutsBrick' has been fixed to be 'ResultsBrick'.
- In 'forms.event', the global variables '_SYMMETRICS' & '_TYPES' have been removed.
* CTI :
- The function 'utils.print_phone()' has been renamed 'utils.print_phone_html()'.
* VCFs :
- In 'forms.vcf' :
- The constant 'IMG_UPLOAD_PATH' has been removed.
- In the class 'VcfImportForm' :
- The methods '_create_contact()', '_create_address()' & '_create_image()' have been removed.
- The method '_init_orga_field()' has been renamed '_init_orga_fields()'.
Javascript :
- The function 'creme.ajax.json.ajaxFormSubmit' has been removed.
- The jQuery package 'extensions/utils.js' has been reworked, and renamed as 'extensions/jquery.toggle-attr.js' :
- The extensions '$.fn.check()', '$.fn.uncheck()' & '$.fn.toggleCheck' have been removed.
- The extension '$.fn.toggleProp' has been added.
- The jQuery extension '$.fn.wait()' has ben removed (not useful anymore).
- The jQuery extension '$.toJSON()' has been removed ; use 'JSON.stringify()' instead.
- These unused dependencies have been removed :
- jquery.cookie.js
- jquery.highlight.js
- jquery.bind-first.js
Internal breaking changes :
---------------------------
(they should not cause problem if you have not deeply modified the source code of Creme)
The method 'creme_core.apps.CremeCoreConfig.tag_ctype()' has been removed.
The function 'creme_core.checks.check_secret_key()' has been removed.
In 'creme_core.core.job' :
- the functions '_build_*_command()' have been removed.
- the global variable 'COMMANDS' has been removed.
The class attribute 'creme_core.utils.meta._FilterModelFieldQuery._TAGS' has been removed.
There were several changes in 'creme.utils.loggers.CremeFormatter'.
In 'mediagenerator':
- In 'settings', some global variables have been removed: GENERATED_MEDIA_DIR, _media_dir.
- In 'utils', these functions have been removed: _load_generators(), _refresh_dev_names().
Apps :
* Recurrents :
- In 'registry' :
- The attribute 'RecurrentRegistry._apps' has been replaced by '_template_forms'.
- The classes 'TemplateRecurrentRegistry' & 'AppRecurrentRegistry' have been removed.
* VCFs :
- Several useless methods have been removed in 'vcf_lib.base'.