Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

odoo-typescript

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

odoo-typescript

Type declarations for odoo modules

latest
Source
npmnpm
Version
2.2.0
Version published
Maintainers
1
Created
Source

odoo-typescript

Type declarations for odoo

With odoo-typescript you can use your favorite bundler to build your odoo modules.

Advantages of odoo-typescript:

  • Just use npm install to add dependencies
  • Out-of-the-box auto-completion for all odoo modules

Disadvantages:

  • Extra build step

API

Aside from the type declarations odoo-typescript also includes some methods:

require

Import an existing module

import * as ots from 'odoo-typescript/v18.0'

const owl = ots.require('@odoo/owl')

define

Define a module

import * as ots from 'odoo-typescript/v18.0'
import type { ORM } from 'odoo-typescript/v18.0/dist/addons/web/core/orm_service'

ots.define({
    name: "@my_module/foo",
    deps: {
        hooks: "@web/core/utils/hooks",
        owl: "@odoo/owl",
    },
    factory({hooks, owl}) {
        const orm: ORM = hooks.useService("orm_service")
        
        class MyComponent extends owl.Component {
            // custom owl component
        }

        return {
            MyComponent
        }
    },
})

definePatch

Patch an object

import * as ots from 'odoo-typescript/v18.0'

ots.definePatch({
    deps: { navbar: '@point_of_sale/app/navbar/navbar' },
    objToPatch({navbar}) {
        return navbar.Navbar.prototype
    },
    patch() {
        return {
            setup() {
                super.setup()
                console.log("Patching Navbar ...")
            }
        }
    },
})

Add type inference for custom modules

To enable auto-completion for custom modules you need to extend the interface Modules.

import * as ots from 'odoo-typescript/v18.0'

const foo = ots.define({
    name: '@mymodule/foo'
    deps: {},
    factory() {
        // ...
    }
}

declare module 'odoo-typescript/18.0' {
  export interface Modules {
    '@mymodule/foo': Awaited<typeof foo>
  }
}

Keywords

odoo

FAQs

Package last updated on 15 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts