Repository
OCA/dms · module folder · Try on Runboat
Module version
Category
Uncategorized
Folder size
1.28 MB
License
LGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/dms
Last tracking update
2026-08-11 17:15:20
Authors
Odoo Community Association (OCA), Creu Blanca
Maintainers
Odoo Community Association (OCA), Creu Blanca
Committers
Enric Tobella, Víctor Martínez, Carlos Roca, CarlosRoca13, Weblate, OCA-git-bot, oca-ci, anusrinps96
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
dms_field_auto_classification, hr_dms_field
Description
This addon creates a new kind of view and allows to define a folder
related to a record.

Code Analysis

Views touched (7)
XML IDNameModelTypeStatus
dms_directory_dms_tree_view dms.directory.dms_tree (in dms_field) dms.directory dms_list New
dms_storage_dms_tree_view dms.storage.dms_tree (in dms_field) dms.storage dms_list New
view_dms_access_groups_form dms_access.group.form dms.access.group form Inherits dms.view_dms_access_groups_form
view_dms_access_groups_tree dms_access_groups.tree dms.access.group tree Inherits dms.view_dms_access_groups_tree
view_dms_field_template_form dms.field.template form New
view_dms_field_template_tree dms.field.template list New
view_partner_form res.partner.form res.partner form Inherits base.view_partner_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (8)

New fields (2)
  • company_id Many2one → res.company
    comodel_name='res.company' compute='_compute_company_id' store=True string='Company'
  • dms_field_ref Reference
    selection='_selection_reference_value' string='DMS field reference'
Public methods (0)

No public methods.

New fields (1)
  • parent_id Many2one
    default=<expr>
Public methods (2)
  • search_parents(self, domain=False, offset=0, limit=None, order=None, count=False)
    @api.model
    This method finds the top level elements of the hierarchy for a given search query. :param domain: a search domain <reference/orm/domains> (default: empty list) :param offset: the number of results to ignore (default: none) :param limit: maximum number of records to return (default: all) :param order: a string to define the sort order of the query (default: none) :param count: counts and returns the number of matching records (default: False) :returns: the top level elements for the given search query
  • search_read_parents(self, domain=False, fields=None, offset=0, limit=None, order=None)
    @api.model
    This method finds the top level elements of the hierarchy for a given search query. :param domain: a search domain <reference/orm/domains> (default: empty list) :param fields: a list of fields to read (default: all fields of the model) :param offset: the number of results to ignore (default: none) :param limit: maximum number of records to return (default: all) :param order: a string to define the sort order of the query (default: none) :returns: the top level elements for the given search query

New fields (1)
  • dms_directory_ids One2many → dms.directory
    auto_join=True domain=<expr> string='DMS Directories' args: 'dms.directory', 'res_id'
Public methods (5)
  • create(self, vals_list)
    @api.model_create_multi
    Create a dms directory when creating the record if exist a template. We need to avoid applying a template except when testing functionality with dms_field* modules to avoid the error that a directory with the same name already exists (example: create partner).
  • models_to_track_dms_field_template(self)
    @api.model
    Models to be tracked for dms field templates :args: :returns: list of models
  • unlink(self)
    When deleting a record, we also delete the linked directories and the auto-generated access group.
  • web_save(self, vals, specification, next_id=None)
    We need to intercept this method to avoid a dms.directory access error in some cases. Example: A user is modifying an employee field via UX but does NOT have access to the linked directory (due to the corresponding dms.access.group), even if the dms_directory_ids field were invisible, it would show a dms.directory access error when saving. The appropriate solution is usually to define a group for the dms_directory_ids field so that only users who have access to it can see it, but there is no specific group that allows us to know whether or not the user will have access to the directory, which is why this hack is done.
  • write(self, vals)
    When modifying a record that has linked directories and changing the user_id field it is necessary to update the auto-generated access group (name and explicit_user_ids).

New fields (9)
  • company_id Many2one → res.company
    comodel_name='res.company' index=True store=True string='Company'
  • directory_format_name Char
    default='{{object.display_name}}' help='You can set expressions to be used for the directory name,\n e.g.: {{object.name}}' string='Directory format name'
  • group_ids Many2many → dms.access.group
    comodel_name='dms.access.group' string='Groups'
  • model Char
    compute='_compute_model' compute_sudo=True store=True string='Model name'
  • model_id Many2one → ir.model
    comodel_name='ir.model' domain=[('transient', '=', False), ('model', '!=', 'dms.field.template')] index=True string='Model'
  • name Char
    required=True
  • parent_directory_id Many2one → dms.directory
    comodel_name='dms.directory' domain="[('storage_id', '=', storage_id)]" string='Parent directory'
  • storage_id Many2one → dms.storage
    comodel_name='dms.storage' domain=[('save_type', '!=', 'attachment')] string='Storage'
  • user_field_id Many2one → ir.model.fields
    comodel_name='ir.model.fields' domain="[('model_id', '=', model_id),('relation', '=', 'res.users')]" string='User field'
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
    Create dms directory automatically in the creation in install mode.
  • create_dms_directory(self)
    @api.model
    According to the model, create the directory linked to that record and the subdirectories.

New fields (1)
  • field_template_ids One2many → dms.field.template
    comodel_name='dms.field.template' inverse_name='storage_id' string='File templated ids'
Public methods (1)
  • get_js_tree_data(self)
    @api.model

New fields (1)
  • view_mode Selection
    ondelete={'dms_list': 'cascade'} selection_add=[('dms_list', 'DMS Tree')]
Public methods (0)

No public methods.

New fields (1)
  • type Selection
    selection_add=[('dms_list', 'DMS Tree')]
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Status
Open migration PR — not merged yet for this version
CI status
checks failing
Open since
59 days ago
Last activity
59 days ago
Repository
OCA/dms
Pull request
[19.0][MIG] dms_field: Migration to 19.0 (#486)