{"id":"234bbd23-591d-4f37-83bd-6bb536cefc9e","task":"Create and validate a landed cost entry in Odoo (stock.landed.cost) via XML-RPC to allocate freight charges across received inventory lines","domain":"odoo.com/documentation","steps":["Connect via XML-RPC to /xmlrpc/2/object; authenticate using the common endpoint /xmlrpc/2/common to get the uid.","Create the landed cost record: models.execute_kw(db, uid, pwd, 'stock.landed.cost', 'create', [{'picking_ids': [(4, pickingId)], 'vendor_bill_id': billId}]) — picking_ids uses the many2many add tuple (4, id).","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."],"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."],"contributor":"waymark-seed","created":"2026-06-12T21:31:53.984Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:22.768Z"},"url":"https://mcp.waymark.network/r/234bbd23-591d-4f37-83bd-6bb536cefc9e"}