Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9602548
[IMP] server: xml - menuitem - check that parent is valid
fda-odoo Jul 9, 2025
2f69c19
[IMP] server: xml - menuitem - check validity of action attribute
fda-odoo Jul 9, 2025
625bc11
[IMP] server: menuitem - validate groups attribute
fda-odoo Jul 10, 2025
87bffb9
[FIX] server: fix custom entry point creation on hover
fda-odoo Jul 10, 2025
b162ddf
[IMP] server: record - validate model. Add validation step to xml files
fda-odoo Jul 14, 2025
bf729af
[IMP] server: check for field validity on xml record
fda-odoo Jul 17, 2025
91a665a
[IMP] server: detect "delegate=True" for inherits in models
fda-odoo Jul 17, 2025
8aaad59
[IMP] server: check presence of required field in record (wip)
fda-odoo Jul 17, 2025
12b9f93
[FIX] server: adapt all_members to be correct
mmahrouss Jul 18, 2025
27dfdba
[IMP] server: hover and gotodefinition for record, fields in XML
fda-odoo Jul 18, 2025
b2a6ee8
[IMP] server: basic field diagnostic structure
fda-odoo Jul 22, 2025
eddc577
[IMP] server: references for xml that return all results without depe…
fda-odoo Jul 23, 2025
049b223
[FIX] server: wrong diagnostic for imports with asname
fda-odoo Jul 23, 2025
6cd6382
[IMP] server: remove act_window and _report tags
fda-odoo Jul 23, 2025
4350949
[IMP] server: xml_ids location and xml_ids on packages + gotodef on ref
fda-odoo Jul 23, 2025
5ebcf97
[FIX] server: adapt some diagnostics to new structure
fda-odoo Jul 23, 2025
fd5f1a0
[FIX] server: keep value AND annotation evalution to be sure to not l…
fda-odoo Jul 25, 2025
945f7a5
[IMP] server: support for @language in XML fields
fda-odoo Jul 28, 2025
7c5d71b
[IMP] server: hook for 'global' field on IrRule
fda-odoo Jul 28, 2025
90698f8
[FIX] server: base_attr for decorators
fda-odoo Jul 28, 2025
e93cb8c
[IMP] server: python version check in if tests
fda-odoo Jul 29, 2025
483853c
[FIX] server: OYarn - String compile issues
fda-odoo Jul 29, 2025
2b82465
[FIX] server: browse all evaluations to find a value in _get_attribute
fda-odoo Jul 30, 2025
9ad0329
[FIX] server: do not evaluate call arguments for properties for now
fda-odoo Jul 30, 2025
5709f95
[FIX] server: import directories before compiled
fda-odoo Jul 31, 2025
57058e6
[IMP] server: hooks for werkzeug monkeypatches
fda-odoo Jul 31, 2025
5e8c40c
[FIX] server: crash on rebuild arch of manually created function
fda-odoo Jul 31, 2025
a3ef762
[FIX] server: correctly mark classproperty
mmahrouss Jul 31, 2025
f366e0a
[FIX] server: ensure that base classes are evaluated before odoo step
fda-odoo Aug 1, 2025
664fc18
[IMP] server: various debug improvements
fda-odoo Aug 4, 2025
ed1d344
[IMP] server: improve performancies of is_field
fda-odoo Aug 4, 2025
5d9feca
[FIX] server: posonly args can have a default value
fda-odoo Aug 4, 2025
182cec0
[FIX] server: add args for get method on fields
mmahrouss Aug 5, 2025
679191a
[FIX] server: OLS01007 - various fixs about argument call validation
fda-odoo Aug 6, 2025
28d805c
[FIX] server: resolve relative path in cli mode
fda-odoo Aug 6, 2025
e4e8ce4
[IMP] server: python path as arg in cli mode
fda-odoo Aug 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ byteyarn = "0.5.1"
roxmltree = "0.20.0"
dirs = "5.0"
toml = "0.8.22"
# ittapi = "0.3" # profiling with VTune profiler
[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies]
nix = { version = "0.29.0", features = ["process"] }

Expand Down
2 changes: 1 addition & 1 deletion server/error_code.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# OdooLS Error codes
OdooLS errors are now defined in their own modules, with the codes being available in [the diagnostics codes list file](src\core\diagnostic_codes_list.rs)
OdooLS errors are now defined in their own modules, with the codes being available in [the diagnostics codes list file](src\core\diagnostic_codes_list.rs)
22 changes: 15 additions & 7 deletions server/src/cli_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use tracing::{error, info};

use crate::core::config::ConfigEntry;
use crate::threads::SessionInfo;
use crate::utils::PathSanitizer;
use crate::utils::{get_python_command, PathSanitizer};
use crate::args::Cli;
use std::io::Write;
use std::path::PathBuf;
use std::fs::File;
use std::fs::{self, File};
use serde_json::json;
use crate::core::{config::{DiagMissingImportsMode}, odoo::SyncOdoo};
use crate::S;
Expand Down Expand Up @@ -42,17 +42,25 @@ impl CliBackend {
info!("Using tracked folders: {:?}", workspace_folders);

for (id, tracked_folder) in workspace_folders.into_iter().enumerate() {
session.sync_odoo.get_file_mgr().borrow_mut().add_workspace_folder(format!("{}", id), PathBuf::from(tracked_folder).sanitize());
let tf = fs::canonicalize(tracked_folder.clone());
if let Ok(tf) = tf {
let tf = tf.sanitize();
session.sync_odoo.get_file_mgr().borrow_mut().add_workspace_folder(format!("{}", id), tf);
} else {
error!("Unable to resolve tracked folder: {}", tracked_folder);
}

}

let mut config = ConfigEntry::new();
config.addons_paths = addons_paths.into_iter().collect();
config.odoo_path = community_path;
config.addons_paths = addons_paths.into_iter().map(|p| fs::canonicalize(p).unwrap_or_else(|_| PathBuf::from(S!(""))).sanitize()).collect();
config.odoo_path = Some(fs::canonicalize(community_path.unwrap_or(S!(""))).unwrap_or_else(|_| PathBuf::from(S!(""))).sanitize());
config.refresh_mode = crate::core::config::RefreshMode::Off;
config.diag_missing_imports = DiagMissingImportsMode::All;
config.no_typeshed = self.cli.no_typeshed;
config.additional_stubs = self.cli.stubs.clone().unwrap_or(vec![]).into_iter().collect();
config.stdlib = self.cli.stdlib.clone().unwrap_or(S!(""));
config.additional_stubs = self.cli.stubs.clone().unwrap_or(vec![]).into_iter().map(|p| fs::canonicalize(p).unwrap_or_else(|_| PathBuf::from(S!(""))).sanitize()).collect();
config.stdlib = self.cli.stdlib.clone().map(|p| fs::canonicalize(p).unwrap_or_else(|_| PathBuf::from(S!(""))).sanitize()).unwrap_or(S!(""));
config.python_path = self.cli.python.clone().unwrap_or(get_python_command().unwrap_or(S!("")));
SyncOdoo::init(&mut session, config);

let output_path = self.cli.output.clone().unwrap_or(S!("output.json"));
Expand Down
1 change: 1 addition & 0 deletions server/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub const DEBUG_ODOO_BUILDER: bool = false;
pub const DEBUG_MEMORY: bool = false;
pub const DEBUG_THREADS: bool = false;
pub const DEBUG_STEPS: bool = false;
pub const DEBUG_STEPS_ONLY_INTERNAL: bool = true;
pub const DEBUG_REBUILD_NOW: bool = false;

pub type Tree = (Vec<OYarn>, Vec<OYarn>);
Expand Down
24 changes: 24 additions & 0 deletions server/src/core/diagnostic_codes_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,28 @@ OLS05050, DiagnosticSetting::Error, "Data file {0} is not a valid XML or CSV fil
* An XML_ID should be in the format 'xml_id' or 'module.xml_id', but can't contains more dots
*/
OLS05051, DiagnosticSetting::Error, "Invalid XML ID '{0}'. It should not contain more than one dot.",
/**
* The given parent_id does not exists in the dependents modules, or is not a menuitem
*/
OLS05052, DiagnosticSetting::Error, "Parent menuitem with id '{0}' does not exist",
/**
* A menuitem is specifying an action that has not been declared before the menuitem.
*/
OLS05053, DiagnosticSetting::Error, "Action with id '{0}' does not exist",
/**
* A menuitem is specifying a group that has not been declared before the menuitem
*/
OLS05054, DiagnosticSetting::Error, "Group with id '{0}' does not exist",
/**
* Model not found
*/
OLS05055, DiagnosticSetting::Error, "Model '{0}' not found in module '{1}'",
/**
* Model not found
*/
OLS05056, DiagnosticSetting::Error, "Model '{0}' not found",
/**
* Field not found in model
*/
OLS05057, DiagnosticSetting::Error, "Field '{0}' not found in model '{1}'",
}
4 changes: 4 additions & 0 deletions server/src/core/entry_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ impl EntryPoint {
self.typ == EntryPointType::PUBLIC || self.typ == EntryPointType::BUILTIN
}

pub fn is_main(&self) -> bool {
self.typ == EntryPointType::MAIN || self.typ == EntryPointType::ADDON
}

pub fn get_symbol(&self) -> Option<Rc<RefCell<Symbol>>> {
let tree = self.addon_to_odoo_tree.as_ref().unwrap_or(&self.tree).clone();
let symbol = self.root.borrow().get_symbol(&(tree, vec![]), u32::MAX);
Expand Down
Loading