Track record changesets
base_changeset · OCA/server-tools
Health
61/100
fair
-
Security25/25No findings
-
Activity6/25Last human commit 30 months ago
-
Required by5/250 modules depend on it
-
Maturity25/25In 5 Odoo series since 12.0
Heuristic over the facts below, not an audit · How it's computed
Required by
0
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
3.3 MB
Module directory on disk
Code analysis
9 migration notes
4 models
9 views
0 HTTP endpoints
Migration considerations
- Migrating to 18.0: `user_has_groups()` was removed: use `self.env.user.has_group()`. migration-user-has-groups · source
- Migrating to 18.0: `user_has_groups()` was removed: use `self.env.user.has_group()`. migration-user-has-groups · source
ChangesetFieldRule— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceRecordChangeset— Migrating to 17.0: `name_get` no longer feeds `display_name`: override `_compute_display_name` instead. migration-name-get · sourceview_changeset_field_rule_tree— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). migration-view-tree-tag · sourceview_record_changeset_change_tree— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). migration-view-tree-tag · sourceview_record_changeset_change_tree— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. (2 occurrences in this file) migration-view-attrs-states · sourceview_record_changeset_tree— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). migration-view-tree-tag · sourceview_record_changeset_tree— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. (2 occurrences in this file) migration-view-attrs-states · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 9
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_changeset_field_rule_form |
changeset.field.rule | form | New | |
view_changeset_field_rule_search |
changeset.field.rule | search | New | |
view_changeset_field_rule_tree |
changeset.field.rule | tree | New | |
view_record_changeset_change_form |
record.changeset.change | form | New | |
view_record_changeset_change_search |
record.changeset.change | search | New | |
view_record_changeset_change_tree |
record.changeset.change | tree | New | |
view_record_changeset_form |
record.changeset | form | New | |
view_record_changeset_search |
record.changeset | search | New | |
view_record_changeset_tree |
record.changeset | tree | New |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 4
New fields (6)
-
changeset_change_idsOne2many → record.changeset.changecomodel_name='record.changeset.change'compute='_compute_changeset_ids'string='Changeset Changes' -
changeset_idsOne2many → record.changesetcomodel_name='record.changeset'compute='_compute_changeset_ids'string='Changesets' -
count_changesetsIntegercompute='_compute_count_pending_changesets'help='The overall number of changesets of this record' -
count_pending_changeset_changesIntegercompute='_compute_count_pending_changesets'help='The number of pending changes of this record' -
count_pending_changesetsIntegercompute='_compute_count_pending_changesets'help='The number of pending changesets of this record' -
user_can_see_changesetBooleancompute='_compute_user_can_see_changeset'
-
action_record_changeset_change_view(self) -
create(self, vals_list)@api.model_create_multi -
get_view(self, view_id=None, view_type='form', **options)@api.modelInsert the pending changes smart button in the form view of tracked models. -
models_to_track_changeset(self)@api.model@ormcache(skiparg=1)Models to be tracked for changes :args: :returns: list of models -
write(self, values)
New fields (9)
-
actionSelectionhelp='Auto: always apply a change.\nValidate: manually applied by an administrator.\nNever: change never applied.'required=Trueselection='_selection_action' -
activeBooleandefault=True -
company_idMany2one → res.companydefault=<expr> args: 'res.company' -
expressionTexthelp='Use this rule only on records where this is true. Available variables: object, user' -
field_idMany2one → ir.model.fieldscomodel_name='ir.model.fields'ondelete='cascade'required=True -
model_idMany2onerelated='field_id.model_id'store=True -
prevent_self_validationBooleandefault=False -
source_model_idMany2one → ir.modelcomodel_name='ir.model'domain=<expr>help='If a source model is defined, the rule will be applied only when the change is made from this origin. Rules without source model are global and applies to all backends.\nRules with a source model have precedence over global rules, but if a field has no rule with a source model, the global rule is used.'ondelete='cascade'string='Source Model' -
validator_group_idsMany2many → res.groupsdefault=<expr>string='Validator Groups' args: 'res.groups', 'changeset_field_rule_validator_group_rel'
-
create(self, vals_list)@api.model_create_multi -
get_rules(self, source_model_name, record_model_name)@api.modelReturn the rules for a model When a model is specified, it will return the rules for this model. Fields that have no rule for this model will use the global rules (those without source). The source model is the model which ask for a change, it will be for instance ``res.users``, ``lefac.backend`` or ``magellan.backend``. The second argument (``source_model_name``) is optional but cannot be an optional keyword argument otherwise it would not be in the key for the cache. The callers have to pass ``None`` if they want only global rules. -
init(self)Ensure there is at most one rule with source_model_id NULL. -
unlink(self) -
write(self, vals)
New fields (10)
-
change_idsOne2many → record.changeset.changecomodel_name='record.changeset.change'inverse_name='changeset_id'readonly=Truestring='Changes' -
company_idMany2one → res.companyargs: 'res.company' -
dateDatetimedefault=fields.Datetime.now()index=Truereadonly=Truestring='Modified on' -
modelCharindex=Truereadonly=Truerequired=True -
modified_by_idMany2one → res.usersdefault=<expr>readonly=True args: 'res.users' -
noteText -
record_idReferencecompute='_compute_resource_record'readonly=Trueselection='_reference_models' -
res_idMany2oneReferenceindex=Truemodel_field='model'readonly=Truerequired=Truestring='Record ID' -
sourceReferencereadonly=Trueselection='_reference_models'string='Source of the change' -
stateSelectioncompute='_compute_state'selection=[('draft', 'Pending'), ('done', 'Done')]store=True
-
add_changeset(self, record, values, create=False)@api.modelAdd a changeset on a record By default, when a record is modified by a user or by the system, the the changeset will follow the rules configured for the global rules. A caller should pass the following keys in the context: * ``__changeset_rules_source_model``: name of the model which asks for the change * ``__changeset_rules_source_id``: id of the record which asks for the change When the source model and id are not defined, the current user is considered as the origin of the change. Should be called before the execution of ``write`` on the record so we can keep track of the existing value and also because the returned values should be used for ``write`` as some of the values may have been removed. :param values: the values being written on the record :type values: dict :param create: in create mode, no check is made to see if the field value consitutes a change. :type creatie: boolean :returns: dict of values that should be wrote on the record (fields with a 'Validate' or 'Never' rule are excluded) -
apply(self) -
cancel(self) -
name_get(self)
New fields (42)
-
changeset_idMany2one → record.changesetcomodel_name='record.changeset'ondelete='cascade'readonly=Truerequired=True -
dateDatetimerelated='changeset_id.date' -
field_idMany2one → ir.model.fieldscomodel_name='ir.model.fields'ondelete='cascade'readonly=Truerequired=True -
field_nameCharreadonly=Truerelated='field_id.name' -
field_typeSelectionreadonly=Truerelated='field_id.ttype' -
modelCharreadonly=Truerelated='field_id.model'store=True -
modified_by_idMany2onerelated='changeset_id.modified_by_id' -
new_value_booleanBooleanreadonly=True -
new_value_charCharreadonly=True -
new_value_dateDatereadonly=True -
new_value_datetimeDatetimereadonly=True -
new_value_displayCharcompute='_compute_value_display'string='New' -
new_value_floatFloatreadonly=True -
new_value_integerIntegerreadonly=True -
new_value_monetaryFloatreadonly=True -
new_value_referenceReferencereadonly=Trueselection='_reference_models' -
new_value_textTextreadonly=True -
old_value_booleanBooleanreadonly=True -
old_value_charCharreadonly=True -
old_value_dateDatereadonly=True -
old_value_datetimeDatetimereadonly=True -
old_value_floatFloatreadonly=True -
old_value_integerIntegerreadonly=True -
old_value_monetaryFloatreadonly=True -
old_value_referenceReferencereadonly=Trueselection='_reference_models' -
old_value_textTextreadonly=True -
origin_value_booleanBooleancompute='_compute_origin_values'readonly=True -
origin_value_charCharcompute='_compute_origin_values'readonly=True -
origin_value_dateDatecompute='_compute_origin_values'readonly=True -
origin_value_datetimeDatetimecompute='_compute_origin_values'readonly=True -
origin_value_displayCharcompute='_compute_value_display'string='Previous' -
origin_value_floatFloatcompute='_compute_origin_values'readonly=True -
origin_value_integerIntegercompute='_compute_origin_values'readonly=True -
origin_value_monetaryFloatcompute='_compute_origin_values'readonly=True -
origin_value_referenceReferencecompute='_compute_origin_values'readonly=Trueselection='_reference_models' -
origin_value_textTextcompute='_compute_origin_values'readonly=True -
record_idReferencerelated='changeset_id.record_id' -
rule_idMany2one → changeset.field.rulereadonly=True args: 'changeset.field.rule' -
stateSelectiondefault='draft'readonly=Truerequired=Trueselection=[('draft', 'Pending'), ('done', 'Approved'), ('cancel', 'Rejected')] -
user_can_validate_changesetBooleancompute='_compute_user_can_validate_changeset' -
verified_by_idMany2one → res.usersreadonly=True args: 'res.users' -
verified_on_dateDatetimereadonly=Truestring='Verified on'
-
apply(self)Apply the change on the changeset's record It is optimized thus that it makes only one write on the record per changeset if many changes are applied at once. -
cancel(self)Reject the change -
get_changeset_changes_by_field(self, model, res_id)@api.modelReturn changes grouped by field. :returns: dictionary with field names as keys and lists of dictionaries describing changes as keys. :rtype: dict -
get_field_for_type(self, field, prefix)@api.model -
get_new_value(self) -
get_origin_value(self) -
get_pending_changes_states(self)@api.model -
set_old_value(self)Copy the value of the record to the 'old' field
Loading…
Loading…
Loading…
Loading…