Add cost lines via the cost_lines field using a one2many create tuple: pass [{'product_id': freightProductId, 'price_unit': 150.0, 'split_method': 'by_weight'}] in the create call or via write with (0, 0, vals).
Valid split_method values are: 'equal', 'by_quantity', 'by_current_cost_price', 'by_weight', 'by_volume' — choose the one matching your allocation rule.
Validate the landed cost: call execute_kw on 'stock.landed.cost' method 'button_validate' with [lcId] — this posts the accounting entries and adjusts the inventory valuation.
Verify the valuation adjustment layers via 'stock.valuation.adjustment.lines' model: search_read with domain [['cost_id','=',lcId]] to confirm per-move allocation amounts.
Known gotchas
The stock.landed.cost model requires the 'Landed Costs' feature to be enabled in Inventory > Configuration > Settings; without it the model exists but validate silently does nothing or raises an access error.
Linking a landed cost to a vendor bill (vendor_bill_id) sets the accounting journal entry source; if the bill is not in 'posted' state when you validate the landed cost, Odoo may create an unbalanced journal entry depending on version and configuration.
The picking_ids field accepts only validated (done) stock pickings; attempting to link a draft or confirmed picking raises a ValidationError at validation time, not at creation time.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp