When i make a call to this url from https://github.com/akretion/angular-odoo/blob/master/dist/odoo.js lib i get above error. Please help me to solve this. i am using odoo 9.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Anand,
I too got this issue while making an ajax request to the controller.
Please try making
type:'POST', in your .js ajax request
and in controller decorater it should be something like...
@http.route('/pproject/get_po_prices', methods=['POST'], type='json', auth="public", website=True)
then you can access your data using
data = request.jsonrequest
under yourcontroller
Hope it helps!
Hi, @http.route('/web/webclient/version_info', type='json', auth="none") def version_info(self): return openerp.service.common.exp_version() This is the controller am calling.. This is Ajax call am using $(document).ready(function(){ $("button").click(function(){ $.ajax({url: "https://www.nomado.eu/web/webclient/version_info", success: function(result){ console.log(result); $("#div1").html(result); }}); }); }); But it gives me XMLHttpRequest cannot load https://www.nomado.eu/web/webclient/version_info. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '192.0.12.34' is therefore not allowed access. The response had HTTP status code 400. How to solve this.. please update
the controller @http.route('/web/webclient/version_info', type='json', auth="none") you are calling have type='json', so just call it using jsonrpc, instead of http .
Please post the code you have done so far ,than only we can help you.
Hi, @http.route('/web/webclient/version_info', type='json', auth="none") def version_info(self): return openerp.service.common.exp_version() This is the controller am calling.. This is Ajax call am using $(document).ready(function(){ $("button").click(function(){ $.ajax({url: "https://www.nomado.eu/web/webclient/version_info", success: function(result){ console.log(result); $("#div1").html(result); }}); }); }); But it gives me XMLHttpRequest cannot load https://www.nomado.eu/web/webclient/version_info. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '192.0.12.34' is therefore not allowed access. The response had HTTP status code 400. How to solve this.. please update
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
Auto Completion in odoo
Đã xử lý
|
|
3
thg 2 17
|
7185 | |
how to create new form on web ?
Đã xử lý
|
|
4
thg 1 24
|
13603 | |
|
2
thg 8 25
|
2245 | ||
|
1
thg 7 25
|
778 | ||
|
1
thg 8 25
|
1150 |