CreateIf.OdooSharp.Codegen 0.0.10

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global CreateIf.OdooSharp.Codegen --version 0.0.10
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local CreateIf.OdooSharp.Codegen --version 0.0.10
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CreateIf.OdooSharp.Codegen&version=0.0.10
                    
nuke :add-package CreateIf.OdooSharp.Codegen --version 0.0.10
                    

OdooSharp JSON-RPC C# ORM Client

A type-safe, extensible C# client for interacting with the Odoo JSON-RPC API.
Supports full CRUD, filtering, paging, and model-level attributes for clean data access.


๐Ÿš€ Features

  • ๐Ÿ” Auth via JSON-RPC (/web/session/authenticate)
  • ๐Ÿ” Generic search_read with domain, fields, paging, sorting
  • ๐Ÿ†• create, โœ๏ธ write, ๐Ÿ—‘๏ธ unlink, ๐Ÿ“ฅ read (by ID)
  • ๐Ÿง  Model-level [OdooModel(...)] attribute for smart mapping
  • ๐Ÿ”„ Paged queries
  • โœ… Typed response classes via System.Text.Json

๐Ÿ“ฆ Installation

Just include the nuget package CreateIf.Odoo and your typed model classes into your project.
Requires .netstandard2.1 or compatible with HttpClient, System.Text.Json.


๐Ÿ› ๏ธ Configuration

var options = new OdooClientOptions
{
    Url = "https://your-odoo-instance.odoo.com",
    Database = "your-database-name",
    Username = "your-user@example.com",
    Password = "your-password"
};

var client = new OdooClient(options);

๐Ÿงช Usage

var client = new OdooClient(new OdooClientOptions
{
    Url = "https://your-odoo-url.odoo.com",
    Database = "your-db",
    Username = "you@example.com",
    Password = "your-password"
});

if (await client.AuthenticateAsync())
{
    Console.WriteLine("Authenticated.");

    var models = await client.GetModelsAsync();

    // you can use your custom defined models too
    var quotes = await client.SearchReadAsync<Lieferangebot>(
        model: "x_lieferangebot",
        domain: new object[] { new object[] { "x_status", "=", "offen" } },
        fields: new[] { "x_name", "x_preis", "x_status" },
        limit: 100
    );
}
else
{
    Console.WriteLine("Authentication failed.");
}

The custom model class

[OdooModel("x_lieferangebot", "[[\"x_status\", \"=\", \"offen\"]]")]
public class Lieferangebot
{
    [JsonPropertyName("id")]
    public int Id { get; set; }

    [JsonPropertyName("x_name")]
    public string Name { get; set; }

    [JsonPropertyName("x_preis")]
    public float Preis { get; set; }

    [JsonPropertyName("x_status")]
    public string Status { get; set; }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.0.18 76 4/25/2025
0.0.17 82 4/25/2025
0.0.16 119 4/24/2025
0.0.15 157 4/16/2025
0.0.14 136 4/16/2025
0.0.13 87 4/12/2025
0.0.12 67 4/11/2025
0.0.11 64 4/11/2025
0.0.10 114 4/11/2025
0.0.9 110 4/11/2025