Skip to content

Commit 4b0a321

Browse files
mmahroussfda-odoo
authored andcommitted
[FIX] config: fix addon auto detection
1 parent 2bb69d6 commit 4b0a321

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/core/config.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,11 @@ fn process_paths(
822822
entry.odoo_path = entry.odoo_path.as_ref()
823823
.and_then(|p| fill_or_canonicalize(p, ws_folders, workspace_name, &is_odoo_path, var_map.clone()));
824824

825-
let infer = entry.addons_paths.as_mut().map_or(true, |ps| ps.pop_if(|v| v.value == S!("$autoDetectAddons")).is_some());
825+
let infer = entry.addons_paths.as_mut().map_or(true, |ps| {
826+
let initial_len = ps.len();
827+
ps.retain(|v| v.value != S!("$autoDetectAddons"));
828+
initial_len != ps.len() // $autoDetectAddons is found
829+
});
826830
entry.addons_paths = entry.addons_paths.as_ref().map(|paths|
827831
paths.iter().filter_map(|sourced| {
828832
fill_or_canonicalize(sourced, ws_folders, workspace_name, &is_addon_path, var_map.clone())

0 commit comments

Comments
 (0)