# study/jikimo_sf/sf_mrs_connect/controllers/sync_controller.py from odoo import http from odoo.http import request class FixtureSyncController(http.Controller): @http.route('/api/fixture_model/sync_from_mrs', type='json', auth='none', csrf=False) def sync_model(self, **kw): code = kw.get('code') if not code: return {'status':'fail','msg':'code missing'} request.env['sf.fixture.model'].sudo().sync_from_mrs(code) return {'status':'success'} @http.route('/api/fixture_param/sync_from_mrs', type='json', auth='none', csrf=False) def sync_param(self, **kw): code = kw.get('code') if not code: return {'status':'fail','msg':'code missing'} request.env['sf.fixture.materials.basic.parameters']\ .sudo().sync_from_mrs(code) return {'status':'success'}