Hi Nirmala,
There are a number of options to do this, you can either use Odoo's builtin APIs or if you want to be more flexible you can write a an http or JSON route in Odoo to handle the request.
for eg:
# custom route for json
from odoo import http
from odoo.http import request
import json
class InvoiceBarcodeConfirm(http.Controller):
@http.route('/invoice/barcode/confirm', type='json', auth='public', website=False)
def confirm_invoice(self, **data):
# assuming that the data recieved from flutter has the following structure
# {'user_login': value,'user_pwd':password, 'invoice_barcode': barcode}
if 'user_login' in data and 'user_pwd' in data and 'invoice_barcode' in data:
uid = request.session.authenticate(request.env.cr.dbname, data['user_login'], data['user_pwd'])
if uid.id:
invoice = request.env['account.invoice'].search([('barcode', '=', data['invoice_barcode'])])
if invoice.id:
invoice.action_invoice_open()
return json.dumps({'status': 'success'})
else:
return json.dumps({'status': 'no matching invoice'})
else:
return json.dumps({'status': 'authentication failed'})
else:
return json.dumps({'status': 'not enough parameters received'})
the code is just an illustration to how you can create a custom handler for your request.In case you just need to get your mail and attachments in odoo, you can simply configure external incoming email server from the configurations.
Hope it helped.
Hi,
Are you using Google mobile vision API?
You can use different packages of flutter which helps you to connect with different scripting languages like python, java, .net, etc.
For example you can check this : \Flutter\ package\\\
Likewise\ you\ can\ \;get\ reference\ from\ this\ link\ also\ \:\ \;\Python\ Web\ services\ for\ Flutter\ App\\\
Also\ you\ can\ get\ library\ of\ python\ for\ flutter\ also\ \:\ \;\Python package for Flutter
the above link doesn't work.
And I have idea how to connect flutter with odoo. I need to know is there any video tutorial for storing bar code in odoo with a configurable email address.
thanks
Hi Cybrosys,
Nope. I am not using Google mobile vision API. I even dont have any idea about it. I referred the below link for bar code scanning in flutter.
https://github.com/https://github.com/iampawan/FlutterQRScanner-App/blob/master/lib/main.dartiampawan/FlutterQRScanner-App/blob/master/lib/main.dart
I can able to scan the bar code and stored it in variable. Now I would like to send the store data to odoo with a configrable mail address. How can I achieve this is in odoo?
Note: Main purpose is Often invoices to be paid are received as per email as a pdf attachements. These mails are then forwarded to odoo using a configurable mail address.
thanks