Help Topics for odoo

Project

odoo

Function

Form

Sample CLI

gway odoo Form

Signature

(default: Annotated[Any, Doc('\n            Default value if the parameter field is not set.\n
')] = PydanticUndefined, *, default_factory: Annotated[Optional[Callable[[], Any]], Doc("\n
A callable to generate the default value.\n\n            This doesn't affect `Path` parameters as
the value is always required.\n            The parameter is available only for compatibility.\n
")] = PydanticUndefined, media_type: typing.Annotated[str, Doc("\n            The media type of this
parameter field. Changing it would affect the\n            generated OpenAPI, but currently it
doesn't affect the parsing of the data.\n            ")] = 'application/x-www-form-urlencoded',
alias: Annotated[Optional[str], Doc("\n            An alternative name for the parameter field.\n\n
This will be used to extract the data and for the generated OpenAPI.\n            It is particularly
useful when you can't use the name you want because it\n            is a Python reserved keyword or
similar.\n            ")] = None, alias_priority: Annotated[Optional[int], Doc('\n
Priority of the alias. This affects whether an alias generator is used.\n            ')] =
PydanticUndefined, validation_alias: Annotated[Optional[str], Doc("\n            'Whitelist'
validation step. The parameter field will be the single one\n            allowed by the alias or set
of aliases defined.\n            ")] = None, serialization_alias: Annotated[Optional[str], Doc("\n
'Blacklist' validation step. The vanilla parameter field will be the\n            single one of the
alias' or set of aliases' fields and all the other\n            fields will be ignored at
serialization time.\n            ")] = None, title: Annotated[Optional[str], Doc('\n
Human-readable title.\n            ')] = None, description: Annotated[Optional[str], Doc('\n
Human-readable description.\n            ')] = None, gt: Annotated[Optional[float], Doc('\n
Greater than. If set, value must be greater than this. Only applicable to\n            numbers.\n
')] = None, ge: Annotated[Optional[float], Doc('\n            Greater than or equal. If set, value
must be greater than or equal to\n            this. Only applicable to numbers.\n            ')] =
None, lt: Annotated[Optional[float], Doc('\n            Less than. If set, value must be less than
this. Only applicable to numbers.\n            ')] = None, le: Annotated[Optional[float], Doc('\n
Less than or equal. If set, value must be less than or equal to this.\n            Only applicable
to numbers.\n            ')] = None, min_length: Annotated[Optional[int], Doc('\n            Minimum
length for strings.\n            ')] = None, max_length: Annotated[Optional[int], Doc('\n
Maximum length for strings.\n            ')] = None, pattern: Annotated[Optional[str], Doc('\n
RegEx pattern for strings.\n            ')] = None, regex: Annotated[Optional[str], Doc('\n
RegEx pattern for strings.\n            '), ] = None, discriminator: Annotated[Optional[str], Doc('\n            Parameter
field name for discriminating the type in a tagged union.\n            ')] = None, strict:
Annotated[Optional[bool], Doc('\n            If `True`, strict validation is applied to the field.\n
')] = PydanticUndefined, multiple_of: Annotated[Optional[float], Doc('\n            Value must be a
multiple of this. Only applicable to numbers.\n            ')] = PydanticUndefined, allow_inf_nan:
Annotated[Optional[bool], Doc('\n            Allow `inf`, `-inf`, `nan`. Only applicable to
numbers.\n            ')] = PydanticUndefined, max_digits: Annotated[Optional[int], Doc('\n
Maximum number of allow digits for strings.\n            ')] = PydanticUndefined, decimal_places:
Annotated[Optional[int], Doc('\n            Maximum number of decimal places allowed for numbers.\n
')] = PydanticUndefined, examples: Annotated[Optional[List[Any]], Doc('\n            Example values
for this field.\n            ')] = None, example: Annotated[Optional[Any],
] = PydanticUndefined, openapi_examples:
Annotated[Optional[Dict[str, fastapi.openapi.models.Example]], Doc("\n            OpenAPI-specific
examples.\n\n            It will be added to the generated OpenAPI (e.g. visible at `/docs`).\n\n
Swagger UI (that provides the `/docs` interface) has better support for the\n            OpenAPI-
specific examples than the JSON Schema `examples`, that's the main\n            use case for
this.\n\n            Read more about it in the\n            [FastAPI docs for Declare Request
Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/#using-the-
openapi_examples-parameter).\n            ")] = None, deprecated:
Annotated[Union[typing_extensions.deprecated, str, bool, NoneType], Doc('\n            Mark this
parameter field as deprecated.\n\n            It will affect the generated OpenAPI (e.g. visible at
`/docs`).\n            ')] = None, include_in_schema: typing.Annotated[bool, Doc("\n            To
include (or not) this parameter field in the generated OpenAPI.\n            You probably don't need
it, but it's available.\n\n            This affects the generated OpenAPI (e.g. visible at
`/docs`).\n            ")] = True, json_schema_extra: Annotated[Optional[Dict[str, Any]], Doc('\n
Any additional JSON schema data.\n            ')] = None, **extra: Annotated[Any, Doc('\n
Include extra fields used by the JSON Schema.\n            '), ]) -> Any

TODOs

# TODO: update when deprecating Pydantic v1, import these types # validation_alias: str | AliasPath | AliasChoices | None

Project

odoo

Function

asynccontextmanager

Sample CLI

gway odoo asynccontextmanager

Signature

(func)

Docstring

@asynccontextmanager decorator. Typical usage: @asynccontextmanager async def some_async_generator(): try: yield finally: This makes this: async with some_async_generator() as : equivalent to this: try: = finally:

Project

odoo

Function

create_quote

Sample CLI

gway odoo create-quote

References

['error']

Signature

(*, customer, template_id, validity=None, notes=None)

Docstring

Create a new quotation using a specified template and customer name. Parameters: customer (str): The name (or partial name) of the customer to link to the quote. template_id (int): The ID of the quotation template to use. validity (str, optional): The expiration date for the quote in 'YYYY-MM-DD' format. notes (str, optional): Internal notes or message to include in the quote. Returns: dict: The created quotation details.

Project

odoo

Function

execute_kw

Sample CLI

gway odoo execute-kw

References

['debug', 'error', 'exception', 'info', 'warning']

Signature

(*args, model: str, method: str, url: str = '[ODOO_BASE_URL]', db_name: str = '[ODOO_DB_NAME]',
username: str = '[ODOO_ADMIN_USER]', password: str = '[ODOO_ADMIN_PASSWORD]', **kwargs) -> dict

Docstring

A generic function to directly interface with Odoo's execute_kw method. Parameters: model (str): The Odoo model to interact with (e.g., 'sale.order'). method (str): The method to call on the model (e.g., 'read', 'write'). args (list): Positional arguments to pass to the method. kwargs (dict): Keyword arguments to pass to the method. Returns: dict: The result of the execute_kw call.

Project

odoo

Function

fetch_customers

Sample CLI

gway odoo fetch-customers

References

['error']

Signature

(*, name=None, email=None, phone=None, country=None, latest_quotes=None, **kwargs)

Docstring

Fetch customers from Odoo with optional filters. Parameters: name (str, optional): Filter customers by their name or part of it. email (str, optional): Filter customers by their email address or part of it. phone (str, optional): Filter customers by their phone number or part of it. country (str, optional): Filter customers by their country name or part of it. **kwargs: Additional filters to be applied, passed as key-value pairs. Returns: dict: The fetched customers.

TODOs

# TODO: If latest_quotes is a number, also fetch the many latest quotes for this customer.

Project

odoo

Function

fetch_order

Sample CLI

gway odoo fetch-order

Signature

(order_id)

Docstring

Fetch the details of a specific order by its ID from Odoo, including all line details.

Project

odoo

Function

fetch_products

Sample CLI

gway odoo fetch-products

Signature

(*, name=None, latest_quotes=None)

Docstring

Fetch the list of non-archived products from Odoo. If a name is provided, use it as a partial filter on the product name.

Project

odoo

Function

fetch_quotes

Sample CLI

gway odoo fetch-quotes

References

['error']

Signature

(*, state='draft', older_than=None, salesperson=None, customer=None, **kwargs)

Docstring

Fetch quotes/quotations from Odoo with optional filters. Parameters: state (str): Filter quotations by their state. Default is 'draft'. older_than (int, optional): Filter quotations older than a specific number of days. salesperson (str, optional): Filter quotations by the salesperson's name or part of it. customer (str, optional): Filter quotations by the customer's name or part of it. kwargs (list, optional): Additional domain filters for the query. Returns: dict: The fetched quotations.

Project

odoo

Function

fetch_templates

Sample CLI

gway odoo fetch-templates

References

['error']

Signature

(*, name=None, active=True, **kwargs)

Docstring

Fetch available quotation templates from Odoo with optional filters. Parameters: name (str, optional): Filter templates by name or part of it. active (bool): Whether to include only active templates. Defaults to True. **kwargs: Additional filters as key-value pairs. Returns: dict: The fetched quotation templates.

Project

odoo

Function

get_user_info

Sample CLI

gway odoo get-user-info

References

['error']

Signature

(*, username: str) -> dict

Docstring

Retrieve Odoo user information by username.

Project

odoo

Function

read_chat

Sample CLI

gway odoo read-chat

Signature

(*, unread: bool = True, username: str = '[ODOO_USERNAME]') -> list[dict]

Docstring

Read chat messages from an Odoo user by username. If unread is True, only return unread messages.

Project

odoo

Function

send_chat

Sample CLI

gway odoo send-chat

Signature

(message: str, *, username: str = '[ODOO_USERNAME]') -> bool

Docstring

Send a chat message to an Odoo user by username.

Project

odoo

Function

setup_chatbot_app

Sample CLI

gway odoo setup-chatbot-app

References

['error']

Signature

(*, path='/chatbot', username='[ODOO_USERNAME]', alias='Operator', apps=None)

Docstring

Create a FastAPI app (or append to existing ones) serving a chatbot UI and logic.