Usecase to reproduce: - Create a bom without line - Add a new line without filling the product_id Click on bom cost button that appears It crashes because the xml try to access item dict instead of using get and 'components' and 'lines' both not exist.