CRITICAL: before starting, first use Read to read
../openerp-shared/SKILL.md(authentication, exit codes, and output contract are all there).
When to use
- Query the child items of a BOM (materials, usage numerator/denominator, loss rate, self-made/purchased flag).
- Query BOM document details.
- As input for cost estimation (materials × price list).
Command
| Command | Read/Write | Key parameters |
|---|---|---|
openerp bom view --number "<BOM编号>" |
Read | --number(required), e.g. "1.30.67.0132 VA0" |
openerp bom list --material "<父物料编码>" |
Read | --material(required),--top N |
bom list Child item fields returned: child item code/name/specification,FNumerator(numerator),FDenominator(denominator),FScrapRate(loss rate %),FErpClsID(1=purchased/2=self-made), unit, BOM number.
Example
openerp bom view --number "1.30.67.0132 VA0"
openerp bom list --material "1.30.67.0132" --top 100
openerp bom list --material "1.30.67.0132" --format table # 人类可读表格
Fallback: use the generic query to query any form
When domain commands do not cover it, fall back to query:
# 采购价目(验证锚点:物料 4.50.20.1549 价≈9.318584 / 含税10.53 / 税率13%)
openerp query --form-id PUR_PriceCategory \
--fields "FMaterialId.FNumber,FPrice,FTaxPrice,FTaxRate,FDocumentStatus" \
--filter "FMaterialId.FNumber='4.50.20.1549'" --jq '.data'
Routing hints
- Materialprice/purchase pricequery →
query --form-id PUR_PriceCategory(non-BOM command). - Authentication/network/parameter errors → first check the exit code and
hint, runopenerp doctor(seeopenerp-shared)。