To access the total products from the BOM data in Odoo using XML-RPC, you can use the "search" and "read" methods to search for and read all of the BOM records in the database.
To search for all of the BOM records, you can use the following code:
ids = models.execute_kw(DB, uid, ODOO_PWD, 'mrp.bom', 'search', [[]])
This code will search for all of the BOM records in the database and return a list of IDs for the records that were found. You can then use these IDs to read the BOM records and access the data that you need.
To read the BOM records and access the product data, you can use the following code:
boms = models.execute_kw(DB, uid, ODOO_PWD, 'mrp.bom', 'read', [ids])
This code will read the BOM records and return a list of dictionaries containing the data for each BOM record. You can then access the product data from the dictionaries using the keys for the product fields, such as "product_id" and "product_qty".
To access the product structure and attachments for a BOM record, you can use the "search" and "read" methods to search for and read the BOM lines and attachments for the BOM record. For example, you can use the following code to search for the BOM lines for a BOM record:
ids = models.execute_kw(DB, uid, ODOO_PWD, 'mrp.bom.line', 'search', [[['bom_id', '=', BOM_ID]]])
This code will search for all of the BOM lines for the BOM record with the ID BOM_ID, and return a list of IDs for the BOM lines that were found. You can then use these IDs to read the BOM lines and access the data that you need.
To read the BOM lines and access the product data, you can use the following code:
lines = models.execute_kw(DB, uid, ODOO_PWD, 'mrp.bom.line', 'read', [ids])
This code will read the BOM lines and return a list of dictionaries containing the data for each BOM line. You can then access the product data from the dictionaries using the keys for the product fields, such as "product_id" and "product_qty".
To access the attachments for a BOM record, you can use the "search" and "read" methods to search for and read the attachments for the BOM record. For example, you can use the following code to search for the attachments for a BOM record:
ids = models.execute_kw(DB, uid, ODOO_PWD, 'ir.attachment', 'search', [[['res_model', '=', 'mrp.bom'], ['res_id', '=', BOM_ID]]])
This code will search for all of the attachments for the BOM record with the ID BOM_ID, and return a list of IDs for the attachments that were found. You can then use these IDs to read the attachments and access the data that you need.
The file storage methods available cannot be accessed remotely. Can any body guide with the work around?