Skip to content

REFACTOR Make queue_job dependencies optional - #278

Merged
ecino merged 3 commits into
18.0from
ecino/queue-job-optional
Jul 2, 2026
Merged

REFACTOR Make queue_job dependencies optional#278
ecino merged 3 commits into
18.0from
ecino/queue-job-optional

Conversation

@ecino

@ecino ecino commented Jun 29, 2026

Copy link
Copy Markdown
Member
  • NEW module queue_job_sh_safe that will safely use queue_jobs when available and fallback to an alternate mechanism with ir_cron in case the module is not installed.
  • This is useful for Nordic using odoo.sh on which queue jobs are prohibited and not optimal for the infrastructure

- NEW module queue_job_sh_safe that will safely use queue_jobs when available and fallback to an alternate mechanism with ir_cron in case the module is not installed.
- This is useful for Nordic using odoo.sh on which queue jobs are prohibited and not optimal for the infrastructure

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the dependency on queue_job with queue_job_optional across several modules, transitioning from standard with_delay calls to with_delay_sh for asynchronous execution. It also attempts to make dictionary access safer when retrieving product_id and contract_id in bank_statement_line.py. However, the reviewer identified a potential TypeError in this safe-access implementation if the fields are present but set to False (the standard representation for empty many2one fields in Odoo), and provided a code suggestion to resolve this issue.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread account_reconcile_compassion_ce/models/bank_statement_line.py Outdated
@greptile-apps

greptile-apps Bot commented Jun 29, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The change is not ready to merge until the manifest dependency name is corrected.

The touched area is narrow and the main issue is a concrete install/upgrade blocker in the module dependency declaration.

account_statement_import_compassion_ee/manifest.py and recurring_contract/manifest.py

T-Rex T-Rex Logs

What T-Rex did

  • Reproduced the dependency resolution failure by running the generated Odoo-style manifest dependency resolver against the repository addon path; it exited with code 1 because account_statement_import_compassion_ee declares queue_job_optional but no local addon with that technical name exists.
  • Compared with_delay scheduling behavior before and after changes; the base path raised AttributeError when queue_job/with_delay was unavailable, and the head path used a with_delay_sh fallback.
  • Verified the statement-import-queue-fallback behavior by comparing before and after commits: the base state failed with AttributeError, while the head state calls FALLBACK_CALLED with with_delay_sh and exits 0.
  • Tested handling of falsy and empty fields for product_id and contract_id: the base state raised TypeError and IndexError for certain cases, while the head state returned successfully for all falsy/empty cases and continued to return first-element IDs for tuple/list cases.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (3): Last reviewed commit: "Merge branch '18.0' into ecino/queue-job..." | Re-trigger Greptile

Comment thread account_reconcile_compassion_ce/models/bank_statement_line.py Outdated
ecino and others added 2 commits June 29, 2026 15:31
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ecino
ecino force-pushed the ecino/queue-job-optional branch from 9f153d2 to 14ac9b3 Compare June 29, 2026 14:08
"depends": [
# OCA/queue
"queue_job",
"queue_job_optional",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Fix dependency name
The manifests now depend on queue_job_optional, but this repository does not add that module and the PR description names the new compatibility module as queue_job_sh_safe. With the current dependency, Odoo cannot install or upgrade account_statement_import_compassion_ee or recurring_contract unless an unrelated addon named queue_job_optional is present in the addons path.

Artifacts

Repro: generated manifest dependency resolver script

  • Contains supporting evidence from the run (text/x-python; charset=utf-8).

Repro: resolver terminal output showing missing queue_job_optional dependency

  • Keeps the command output available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex

@ecino

ecino commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

LGTM

@ecino
ecino merged commit cbcfe82 into 18.0 Jul 2, 2026
2 checks passed
@ecino
ecino deleted the ecino/queue-job-optional branch July 2, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant