Tips
Records have an int method.
Often we have a function that depends on a Many2one relation sent via the context. Think warehouse_id , cuurency_idor product_id. The problem is sometimes this might be sent as an integer, sometimes the record, or even as a string. This often leads to code like if isinstance(...): convert