Intechnity-com / OdooJsonRpcClient

Odoo Client Json Rpc
MIT License
67 stars 29 forks source link

Missing some enum value identifiers in the OdooModelMapper.GetDotNetModel #51

Closed manitra closed 1 year ago

manitra commented 1 year ago

When generating the .NET models for some models, some enums are generated with a missing identifier for the first enum value. I would expect the identifier to be called None for example to express the fact that none of the following options are selected.

Example of PayrollResUsersOdooEnum

/// <summary>
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum PayrollResUsersOdooEnum
{
[EnumMember(Value = "False")]
 = 1,                                                                    // error CS1001: Identifier expected

[EnumMember(Value = "80")]
Officer = 2,

[EnumMember(Value = "81")]
Manager = 3,
}

List of impacted enums

I got this for the following enums :


Odoo version : v16 .NET version : .NET Core 6 Platform : Mac M1

patricoos commented 1 year ago

Hi, You can change it quickly, name it None as you wanted, I'll take care of it in the next release

manitra commented 1 year ago

Hi @patricoos,

I just submitted the pull request #57 which solves the problem on my side.