Skip to content

Commit

Permalink
Merge PR #264 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Oct 25, 2023
2 parents 592d7a7 + 485d5aa commit 14925f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions dms/models/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ class Storage(models.Model):
help="Indicate if directories and files auto-create in mail "
"composition process too",
)
model = fields.Char(search="_search_model", store=False)

def _search_model(self, operator, value):
allowed_items = self.env["ir.model"].sudo().search([("model", operator, value)])
return [("model_ids", "in", allowed_items.ids)]

@api.onchange("save_type")
def _onchange_save_type(self):
Expand Down
2 changes: 1 addition & 1 deletion dms_field/static/src/js/base/dms_tree_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ odoo.define("dms.DmsTreeController", function (require) {
["child_directory_ids", "in", params.initialState.res_ids],
];
} else {
storage_domain = [["model_ids.model", "=", model]];
storage_domain = [["model", "=", model]];
autocompute_directory = true;
show_storage = false;
}
Expand Down

0 comments on commit 14925f2

Please sign in to comment.