This commit is contained in:
陈赓
2025-07-17 11:08:42 +08:00
parent cdf6a36c30
commit f4829f57a1
5 changed files with 94 additions and 96 deletions

View File

@@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
from odoo import http
from odoo.http import request
class FixtureRedisRefreshController(http.Controller):
@http.route('/api/refresh_redis/fixture_param', type='json', auth='none', csrf=False, methods=['POST'])
def refresh_fixture_param_redis(self, **kw):
request.env['mrs.basic_parameters.mixin'].sudo().refresh_all_param_redis()
return {'status': 'success', 'msg': 'Redis 缓存已刷新'}

View File

@@ -1,22 +0,0 @@
# 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'}