Cobra · Odoo XML-RPC admin + field debugging
Sony Bravia II price update + zero margin diagnostic
Context
Mass update of lst_price for 19 Sony Bravia II SKUs via XML-RPC. After the update, the "Margin" field stayed at 0% in the UI despite a visible supplier cost of €1,224.30.
What was built
- XML-RPC script: search by
default_code, display IDs + prices before writing, then updatelst_price— 19/19 OK - 0% margin diagnostic:
fields_get+readonweb_margin_amount,standard_price,sellers_first_price,list_price - Root cause:
web_margin_amountdepends onstandard_price(= €0.00), while the UI displayssellers_first_priceunder "Cost" - Two fix options explained (Automated Action vs one-shot script)
What was tricky
standard_price= €0.00 via XML-RPC while the UI shows "Cost: €1,224.30" — the UI usessellers_first_priceir.propertyno longer exists in Odoo 18 (lead quickly eliminated)
Stack
Python 3, xmlrpc.client, product.product, product.template, product.supplierinfo, Odoo 18.
What this illustrates
Odoo administration without the UI: safe mass update (display before write), then investigation of a display bug by reading field metadata (fields_get) to trace the root cause without access to source code.