Class Odoo
Allows in/out operations and/or data validations with an Odoo instance.
Implements
Inherited Members
Namespace: AutoCheck.Core.Connectors
Assembly: AutoCheck.dll
Syntax
public class Odoo : Postgres, IDisposable
Constructors
| Improve this Doc View SourceOdoo(Int32, String, String, String, String, String)
Creates a new connector instance.
Declaration
public Odoo(int companyID, string host, string database, string username, string password = null, string binPath = "C:\\Program Files\\PostgreSQL\\10\\bin")
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | companyID | The company ID which will be used to operate. |
System.String | host | Host address in order to connect with the running PostgreSQL service, wich contains the Odoo database. |
System.String | database | The Odoo database name. |
System.String | username | The Odoo database username, which will be used to perform operations. |
System.String | password | The Odoo database password, which will be used to perform operations. |
System.String | binPath |
Odoo(String, String, String, String, String, String)
Creates a new connector instance.
Declaration
public Odoo(string companyName, string host, string database, string username, string password = null, string binPath = "C:\\Program Files\\PostgreSQL\\10\\bin")
Parameters
Type | Name | Description |
---|---|---|
System.String | companyName | The company name which will be used to operate. |
System.String | host | Host address in order to connect with the running PostgreSQL service, wich contains the Odoo database. |
System.String | database | The Odoo database name. |
System.String | username | The Odoo database username, which will be used to perform operations. |
System.String | password | The Odoo database password, which will be used to perform operations. |
System.String | binPath |
Properties
| Improve this Doc View SourceCompanyID
The current company ID that will be used to acces and filter all the requested data.
Declaration
public int CompanyID { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
CompanyName
The current company name.
Declaration
public string CompanyName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceGetCompanyData(Int32)
Requests for the company data.
Declaration
public DataTable GetCompanyData(int companyID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | companyID | The company ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The company data (all the 'res.company' table fields, logo). |
GetCompanyData(String)
Requests for the company data.
Declaration
public DataTable GetCompanyData(string companyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | companyName | The company name wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The company data (all the 'res.company' table fields, logo). |
GetCompanyID(String, Boolean)
Requests for the company ID.
Declaration
public int GetCompanyID(string companyName, bool strict = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | companyName | The company name wich will be used to request. |
System.Boolean | strict | When strict is on, the company name match will be exact. |
Returns
Type | Description |
---|---|
System.Int32 | The company ID. |
GetInvoiceCode(String)
Requests for the invoice code.
Declaration
public string GetInvoiceCode(string orderCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | orderCode | The order code, related to the invoice, wich will be used to request. |
Returns
Type | Description |
---|---|
System.String | The invoice data. |
GetInvoiceData(Int32)
Requests for the purchase data, header and lines
Declaration
public DataTable GetInvoiceData(int invoiceID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | invoiceID | The invoiceID ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The purchase data. |
GetInvoiceData(String)
Requests for the invoice data, headers only
Declaration
public DataTable GetInvoiceData(string orderCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | orderCode | The order code, related to the invoice, wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The invoice data. |
GetInvoiceID(String)
Requests for the invoice code.
Declaration
public int GetInvoiceID(string orderCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | orderCode | The order code, related to the invoice, wich will be used to request. |
Returns
Type | Description |
---|---|
System.Int32 | The invoice data. |
GetLastPosSaleID()
Requests for the last (higher) Point Of Sale sale ID.
Declaration
public int GetLastPosSaleID()
Returns
Type | Description |
---|---|
System.Int32 | The last POS sale ID (id, code, amount_total, product_name, product_qty, product_price_unit, product_id). |
GetLastPurchaseID()
Requests for the last purchase ID (the higher ID).
Declaration
public int GetLastPurchaseID()
Returns
Type | Description |
---|---|
System.Int32 | The last purchase ID. |
GetLastSaleID()
Requests for the last (higher) sale ID.
Declaration
public int GetLastSaleID()
Returns
Type | Description |
---|---|
System.Int32 | The last sale ID. |
GetPosSaleCode(Int32)
Requests for the Point Of Sale sale code.
Declaration
public string GetPosSaleCode(int posSaleID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | posSaleID | The POS sale ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.String | The POS sale code. |
GetPosSaleData(Int32)
Requests for the Point Of Sale sale data, header and lines.
Declaration
public DataTable GetPosSaleData(int posSaleID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | posSaleID |
Returns
Type | Description |
---|---|
System.Data.DataTable | The POS sale data. |
GetPosSaleData(String)
Requests for the Point Of Sale sale data, header and lines.
Declaration
public DataTable GetPosSaleData(string posSaleCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | posSaleCode |
Returns
Type | Description |
---|---|
System.Data.DataTable | The POS sale data. |
GetPosSaleID(String)
Requests for the Point Of Sale sale ID.
Declaration
public int GetPosSaleID(string posSaleCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | posSaleCode | The POS sale code wich will be used to request. |
Returns
Type | Description |
---|---|
System.Int32 | The POS sale ID (id, code, amount_total, product_name, product_qty, product_price_unit, product_id). |
GetProductTemplateData(Int32)
Requests for the product template data, so all the product data (including variants) can be retrieved.
Declaration
public DataTable GetProductTemplateData(int templateID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | templateID | The product template ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The product template data, including variants (product_id, template_id, name, type, sell_price, purchase_price, supplier_id, file_size, attribute, value). |
GetProductTemplateData(String)
Requests for the product template data, so all the product data (including variants) can be retrieved.
Declaration
public DataTable GetProductTemplateData(string productName)
Parameters
Type | Name | Description |
---|---|---|
System.String | productName | The product name wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The product template data, including variants (product_id, template_id, name, type, sell_price, purchase_price, supplier_id, file_size, attribute, value). |
GetProductTemplateID(String, Boolean)
Requests for the product template ID.
Declaration
public int GetProductTemplateID(string productName, bool strict = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | productName | The product name wich will be used to request. |
System.Boolean | strict | When strict is on, the product name match will be exact. |
Returns
Type | Description |
---|---|
System.Int32 | The product template ID. |
GetProviderData(Int32)
Requests for the provider data.
Declaration
public DataTable GetProviderData(int providerID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | providerID | The provider ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The provider data (all the 'res.partner' table fields, logo). |
GetProviderData(String)
Requests for the provider data.
Declaration
public DataTable GetProviderData(string providerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | The provider name wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The provider data (all the 'res.partner' table fields, logo). |
GetProviderID(String, Boolean)
Requests for the provider ID.
Declaration
public int GetProviderID(string providerName, bool strict = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerName | The provider name wich will be used to request. |
System.Boolean | strict | When strict is on, the provider name match will be exact. |
Returns
Type | Description |
---|---|
System.Int32 | The provider ID. |
GetPurchaseCode(Int32)
Requests for the purchase code.
Declaration
public string GetPurchaseCode(int purchaseID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | purchaseID | The purchase ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.String | The purchase ID. |
GetPurchaseData(Int32)
Requests for the purchase data, header and lines
Declaration
public DataTable GetPurchaseData(int purchaseID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | purchaseID | The purchase ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The purchase data (id, code, amount_total, product_name, product_qty, product_price_unit, product_id) |
GetPurchaseData(String)
Requests for the purchase data, header and lines
Declaration
public DataTable GetPurchaseData(string purchaseCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | purchaseCode | The purchase code wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The purchase data (id, code, amount_total, product_name, product_qty, product_price_unit, product_id) |
GetPurchaseID(String)
Requests for the purchase ID.
Declaration
public int GetPurchaseID(string purchaseCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | purchaseCode | The purchase code wich will be used to request. |
Returns
Type | Description |
---|---|
System.Int32 | The purchase ID. |
GetSaleCode(Int32)
Requests for the sale code.
Declaration
public string GetSaleCode(int saleID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | saleID | The sale ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.String | The sale code. |
GetSaleData(Int32)
Requests for the sale data, header and lines.
Declaration
public DataTable GetSaleData(int saleID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | saleID | The sale ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The sale data (id, code, amount_total, product_name, product_qty, product_price_unit, product_id). |
GetSaleData(String)
Requests for the sale data, header and lines.
Declaration
public DataTable GetSaleData(string saleCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | saleCode | The sale code wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The sale data (id, code, amount_total, product_name, product_qty, product_price_unit, product_id). |
GetSaleID(String)
Requests for the sale ID.
Declaration
public int GetSaleID(string saleCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | saleCode | The sale code wich will be used to request. |
Returns
Type | Description |
---|---|
System.Int32 | The sale ID. |
GetScrappedStockData()
Requests for all the information about scrapped stock data.
Declaration
public DataTable GetScrappedStockData()
Returns
Type | Description |
---|---|
System.Data.DataTable | The scrapped stock data. |
GetStockMovementData(String, Boolean)
Requests for the stock movement data, only headers.
Declaration
public DataTable GetStockMovementData(string orderCode, bool isReturn)
Parameters
Type | Name | Description |
---|---|---|
System.String | orderCode | The order code (or number) wich will be used to request. |
System.Boolean | isReturn | If true, the stock movement is related with a return. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The stock movement data (id, product_id, product_name, product_qty, location_id, state). |
GetUserData(Int32)
Requests for the user data, including the groups and permissions
Declaration
public DataTable GetUserData(int userID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userID | The user ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The user data (id, name, active, group). |
GetUserData(String)
Requests for the user data, including the groups and permissions
Declaration
public DataTable GetUserData(string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | The user name wich will be used to request. |
Returns
Type | Description |
---|---|
System.Data.DataTable | The user data (id, name, active, group). |
GetUserID(String, Boolean)
Requests for the user ID.
Declaration
public int GetUserID(string userName, bool strict = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | The user name wich will be used to request. |
System.Boolean | strict | When strict is on, the user name match will be exact. |
Returns
Type | Description |
---|---|
System.Int32 | The user ID. |
GetUserName(Int32)
Requests for the user name.
Declaration
public string GetUserName(int userID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userID | The user ID wich will be used to request. |
Returns
Type | Description |
---|---|
System.String | The user ID. |