TIP: You can type at any time to perform a new search.
Track record changesets
base_changeset · OCA/server-tools
- Repository
- OCA/server-tools · module folder · Try on Runboat
- Module version
- 1.0.0
- Category
- Tools
- Folder size
- 3.3 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/server-tools
- Last tracking update
- 2026-08-07 08:09:23
- Authors
- Camptocamp, Odoo Community Association (OCA), Onestein
- Maintainers
- Camptocamp, Odoo Community Association (OCA), Onestein
- Committers
- Stefan Rijnhart, Weblate, OCA-git-bot, oca-ci
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
- Description
Code Analysis ⓘ
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…