Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Odoo13 How to open a JSON file and read it Avatar arian_shariat@comp.iust.ac.ir 23 February 2021 odoo

Hi,

you can use get_module_resource function to get the right path of the file.

import json
from odoo.modules.module import get_module_resource 


json_file_path = get_module_resource('your_module', 'static/, 'you_file.json')
with open(json_file_path) as f:
    data = json.load(f)
 
PREVIOUS NEXT
Tagged: #How #open #JSON #file #read #Avatar #February #odoo
ADD COMMENT
Topic
Name
2+9 =