Download the PHP package jsadways/odoo-api without Composer

On this page you can find all versions of the php package jsadways/odoo-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package odoo-api

OdooApi Package

Laravel package,封裝與 Odoo 系統的 API 溝通。透過 Odoo Facade 搭配 OdooEndpoint enum 與強型別 DTO 呼叫各 endpoint。

API 文件來源:http://{ODOO_SERVER_HOST}/help?format=json


基本用法

Facade 提供三個方法,對應不同操作類型:

方法 說明
Odoo::create(OdooEndpoint, OdooPayloadDto) 建立資料
Odoo::update(OdooEndpoint, OdooPayloadDto) 更新資料
Odoo::list(OdooEndpoint, OdooPayloadDto) 查詢列表
Odoo::retry() 重試所有失敗的待處理請求

Endpoint 與 DTO 對照表

客戶 / 廠商

Endpoint Method DTO
PARTNER_CREATE POST Partner\PartnerCreateDto
PARTNER_UPDATE PUT Partner\PartnerUpdateDto

產品

Endpoint Method DTO
PRODUCT_CREATE POST Product\ProductCreateDto
PRODUCT_UPDATE PUT Product\ProductUpdateDto

案件

Endpoint Method DTO 子 DTO
CAMPAIGN_CREATE POST Campaign\CampaignCreateDto CampaignCueDto
CAMPAIGN_UPDATE PUT Campaign\CampaignUpdateDto CampaignCueDto

CampaignCueDto 欄位:

欄位 型別 說明
cue_number int Cue 編號
product_id int 產品 ID
budget int|float 預算
month string 月份(YYYYMM)
income int|float 收入
income_total int|float 收入合計
income_discount int|float 收入折讓
income_rebate int|float 收入退佣
cost int|float 成本
cost_total int|float 成本合計
cost_discount int|float 成本折讓
cost_rebate int|float 成本退佣
profit_code string 損益碼
cost_code string 成本碼
id ?int Odoo ID(update 時帶入表示更新既有 cue,不帶則新建)

財務 - 收入

Endpoint Method DTO 子 DTO
INCOME_RECEIPT_LIST GET Income\IncomeReceiptListDto —
INCOME_DISCOUNT_LIST GET Income\IncomeDiscountListDto —
INCOME_RECEIPT_CREATE POST Income\IncomeReceiptCreateDto IncomeReceiptCueDto, NotificationEmailDto
INCOME_RECEIPT_DISCOUNT POST Income\IncomeReceiptDiscountDto IncomeDiscountReceiptDto, IncomeDiscountReceiptCueDto, IncomeCreditNoteDto, IncomeDebitNoteDto, IncomeCostReceiptDto
INCOME_RECEIPT_VOID POST Income\IncomeReceiptVoidDto —
INCOME_RECEIPT_VOID_UPDATE POST Income\IncomeReceiptVoidUpdateDto —
INCOME_DISCOUNT_VOID POST Income\IncomeDiscountVoidDto —

查詢列表

建立收入發票草稿

建立收入發票折讓草稿

作廢

財務 - 成本

Endpoint Method DTO 子 DTO
COST_RECEIPT_LIST POST Cost\CostReceiptListDto —
COST_DISCOUNT_LIST POST Cost\CostDiscountListDto —
COST_RECEIPT_DISCOUNT POST Cost\CostReceiptDiscountDto CostDiscountReceiptDto, CostDiscountReceiptCueDto, CostAllowanceDto, CostCreditNoteDto, CostDebitNoteDto, CostIncomeReceiptDto
COST_DISCOUNT_VOID POST Cost\CostDiscountVoidDto —

建立成本發票折讓草稿


DTO 目錄結構

Retry 機制

每次呼叫 create / update / list 時,請求資料會先寫入 Cache。成功後自動移除,失敗則保留等待 retry。

透過索引 key(odoo_pending_requests)記錄所有待 retry 的 cache key,retry 時依 cached_at 時間排序,先快取的先處理。

手動 retry

回傳陣列,每筆包含 transaction_key、success、result。

自動排程 retry

在 .env 中設定:

啟用後,套件會自動註冊每小時執行一次的排程進行 retry。預設為 false(不啟用)。

主專案需確保 cron 有執行 schedule:run:


設計說明


All versions of odoo-api with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jsadways/odoo-api contains the following files

Loading the files please wait ...