changes
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class FusionOcrController(http.Controller):
|
||||
|
||||
@http.route('/fusion/ocr/request_for_invoice', type='jsonrpc', auth='user')
|
||||
def request_for_invoice(self, move_id):
|
||||
move = request.env['account.move'].browse(int(move_id))
|
||||
move.check_access('write')
|
||||
try:
|
||||
move.action_request_ocr()
|
||||
return {
|
||||
'status': 'ok',
|
||||
'state': move.ocr_state,
|
||||
'backend': move.ocr_backend,
|
||||
'confidence': move.ocr_confidence,
|
||||
'extracted': move.ocr_extracted_data,
|
||||
}
|
||||
except Exception as e:
|
||||
return {'status': 'error', 'message': str(e)}
|
||||
Reference in New Issue
Block a user