Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Javascript :: js element.scrollintoview navbar 
Javascript :: rotate div javascript 
Javascript :: angular readonly/Disabled if value is not null 
Javascript :: Fancybox 2 show error image when not having any image 
Javascript :: mlutiple css jquery 
Javascript :: jquery check if element has child 
Javascript :: http get request in javascript 
Javascript :: ajax call with form data 
Javascript :: javascript get date midnight today 
Javascript :: eslint linebreak style 
Javascript :: javascript add event listener 
Javascript :: jquery change span tag text 
Javascript :: how to reset form values in jquery 
Javascript :: trigger key jquery 
Javascript :: lua manifest code 
Javascript :: webkit-media-controls-timeline apply by jquery 
Javascript :: Iterate with JavaScript While Loops 
Javascript :: react conditional classname 
Javascript :: find array object value is already in use 
Javascript :: javascript loop with delay 
Javascript :: enumerate node js 
Javascript :: set defaultValue for select element jsx 
Javascript :: js add delay with promises 
Javascript :: jquery give control focus 
Javascript :: c# write to file in json 
Javascript :: get number from string javascript 
Javascript :: js map over object 
Javascript :: play store rejected app due non-certified ads SDK 
Javascript :: eslint react native 
Javascript :: if json valide js 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =