Accounting Reference¶
Context¶
Complete reference for all accounting/GL entries created by the device_inventory module. This covers receiving, COGS, invoicing, settlement, and inter-company entries.
Account Configuration¶
Path: Settings → Inventory tab → Device Inventory Accounting

| Account Field | Account Type | Purpose | Example |
|---|---|---|---|
| Device Stock Journal | General journal | All device inventory GL entries | Inventory Valuation |
| Device Valuation Account | Asset (Current) | Balance sheet inventory value | Stock Valuation |
| Device Stock Input Account | Liability (Current) or Expense | Goods received not invoiced (GRNI) | Products to receive |
| Device COGS Account | Expense | Cost of Goods Sold when devices are sold | Cost of Goods Sold |
| Settlement Journal | Purchase journal | Settlement vendor bills | Purchases |
GL Entry #1: Inventory Receipt (Receiving)¶
Triggered by: Mark receiving manifest complete (_create_inventory_accounting_entry() in device_manifest.py)
When: After all devices are scanned/received and manifest is marked done
- Amount: Sum of
purchase_costfor all received manifest lines (including unexpected devices) - Journal: Device Stock Journal
- Auto-posted: Yes (immediately)
- Stored on:
device.manifest.account_move_id - Idempotent: Skips if
account_move_idalready set - One journal entry line per received manifest line (device-level detail)
GL Entry #2: COGS on Delivery (Customer Sale)¶
Triggered by: Mark delivery manifest complete (_create_cogs_accounting_entry() in device_manifest.py)
When: Delivery manifest marked complete for customer sales
- Amount: Sum of
purchase_costfor all picked/delivered devices - Journal: Device Stock Journal
- Stored on:
device.manifest.cogs_move_id - Idempotent: Skips if
cogs_move_idalready set
GL Entry #3: Customer Invoice (Sale)¶
Triggered by: _create_customer_invoice() in device_manifest.py
When: Delivery manifest marked complete
- Uses standard Odoo
sale_order._create_invoices()method - Creates
out_invoice(customer invoice) with: - One line per SO product line
- Price = sale price from SO
- Accounts = standard Odoo product revenue account + AR
- Auto-posted: Yes
- Stored on:
device.manifest.customer_invoice_id
GL Entry #4: COGS on Retail Sale¶
Triggered by: Confirm retail sale (_create_retail_cogs_entry() in device_retail_sale.py)
When: Retail sale record is confirmed
- Amount: Sum of
purchase_costfor all devices in the retail sale - Journal: Device Stock Journal
- Stored on:
device.retail.sale.cogs_move_id
GL Entry #5: Retail Customer Invoice¶
Triggered by: _create_retail_invoice() in device_retail_sale.py
When: Retail sale confirmed
- Creates
out_invoicedirectly (not via SO) - One line per device with
price_unit = sale_price - Taxes cleared (no tax lines)
- Auto-posted: Yes
- Stored on:
device.retail.sale.invoice_id
GL Entry #6: Settlement Vendor Bill¶
Triggered by: _create_settlement_vendor_bill() in consignment_settlement_report.py
When: Consignee settlement report is confirmed AND total_owner_amount > 0
- Creates
in_invoice(vendor bill) in the consignee company's context - Vendor = owner company's partner (e.g., Axis Mobile)
- Amount =
total_owner_amount(total sale proceeds minus commission) - Journal: Settlement Journal (or any purchase journal as fallback)
- Uses
sudo().with_company(consignee_company)to cross company boundaries - Auto-posted: Yes
- Stored on:
consignment.settlement.report.vendor_bill_id
GL Entry #7: COGS on Packing Box Shipment¶
Triggered by: _create_cogs_accounting_entry() in packing_box.py
When: Packing box marked as shipped
Same DR/CR pattern as Entry #2 (COGS entries):
GL Entry #8: Inter-Company Vendor Bill (Auto Mirror)¶
Triggered by: _create_intercompany_bill() in account_move.py
When: An inter-company out_invoice is posted
- Auto-creates mirror
in_invoicein destination company - Bill stays in draft (not auto-posted — unlike other entries)
- Stored on:
account.move.intercompany_bill_id
Summary Table¶
| # | Entry Type | DR Account | CR Account | Journal | Trigger | Auto-posted |
|---|---|---|---|---|---|---|
| 1 | Inventory Receipt | Valuation (asset) | Input (GRNI) | Device Stock | Manifest complete (receiving) | Yes |
| 2 | COGS (delivery) | COGS (expense) | Valuation (asset) | Device Stock | Manifest complete (delivery) | Yes |
| 3 | Customer Invoice | AR | Revenue | Sale journal | Manifest complete (delivery) | Yes |
| 4 | COGS (retail) | COGS (expense) | Valuation (asset) | Device Stock | Retail sale confirm | Yes |
| 5 | Retail Invoice | AR | Revenue | Sale journal | Retail sale confirm | Yes |
| 6 | Settlement Bill | AP clearing | AP | Settlement (purchase) | Settlement report confirm | Yes |
| 7 | COGS (packing) | COGS (expense) | Valuation (asset) | Device Stock | Packing box shipped | Yes |
| 8 | IC Vendor Bill | AP | AP clearing | Purchase (dest co.) | IC invoice posted | No (draft) |
Missing Configuration Behavior¶
| Entry | Behavior when accounts not configured |
|---|---|
| Receiving GL (#1) | Raises UserError |
| COGS on delivery (#2) | Raises UserError |
| COGS on retail (#4) | Raises UserError |
| COGS on packing (#7) | Posts chatter warning (soft fail) |
| Settlement bill (#6) | Posts chatter warning (soft fail) |
Typical Transaction Flow Example¶
A consignment sale of an iPhone (purchase cost $500, sale price $800, 15% commission):
1. Receiving
2. Delivery (COGS)
3. Customer Invoice
4. Settlement Vendor Bill
Owner amount = $800.00 - ($800.00 × 15%) = $800.00 - $120.00 = $680.00