Skip to content

Commit 2858df9

Browse files
committed
[FIX] server: do not build odoo step in custom entrypoint
1 parent b21f815 commit 2858df9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/core/python_arch_eval.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ use ruff_python_ast::{Alias, Arguments, Expr, ExprNamed, FStringPart, Identifier
99
use lsp_types::{Diagnostic, DiagnosticSeverity, NumberOrString, Position, Range};
1010
use tracing::{debug, trace, warn};
1111

12+
use crate::core::entry_point::EntryPointType;
1213
use crate::{constants::*, oyarn, Sy};
1314
use crate::core::import_resolver::resolve_import_stmt;
14-
use crate::core::odoo::SyncOdoo;
15+
use crate::core::odoo::{InitState, SyncOdoo};
1516
use crate::core::symbols::symbol::Symbol;
1617
use crate::core::evaluation::Evaluation;
1718
use crate::core::python_utils;
@@ -701,7 +702,7 @@ impl PythonArchEval {
701702
self.sym_stack.push(class_sym_rc.clone());
702703
self.visit_sub_stmts(session, &class_stmt.body);
703704
self.sym_stack.pop();
704-
if !self.sym_stack[0].borrow().is_external() {
705+
if !self.sym_stack[0].borrow().is_external() && self.sym_stack[0].borrow().get_entry().is_some_and(|e| e.borrow().typ == EntryPointType::MAIN) && session.sync_odoo.state_init == InitState::ODOO_READY {
705706
let odoo_builder_diags = PythonOdooBuilder::new(class_sym_rc).load(session);
706707
self.diagnostics.extend(odoo_builder_diags);
707708
}

0 commit comments

Comments
 (0)