Skip to Content
Menu
This question has been flagged
5 Replies
4941 Views

Hi,

    I have an bar code scanner app with front end as flutter and backend as odoo. I want to know how to store the scanned bar/qr code from flutter to odoo with a configurable email addres. how to create a odoo backend for this situation.?

waiting for replies.

thank in advance

Avatar
Discard

Hi,

Are you using Google mobile vision API?

Hi Keval Mehta,
     Can you please edit your answer in odoo forum.

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\&nbsp\;get\ reference\ from\ this\ link\ also\ \:\&nbsp\;\Python\ Web\ services\ for\ Flutter\ App\\\

Also\ you\ can\ get\ library\ of\ python\ for\ flutter\ also\ \:\&nbsp\;\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


On Tue, Dec 17, 2019 at 3:37 PM Keval Mehta <mehtakevalaf@gmail.com> wrote:

A new answer on how to store bar code result in to odoo from flutter has been posted. Click here to access the post :

See post

Sent by Odoo S.A. using Odoo.

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


Best Answer

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.

Avatar
Discard
Best Answer

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\&nbsp\;get\ reference\ from\ this\ link\ also\ \:\&nbsp\;\Python\ Web\ services\ for\ Flutter\ App\\\

Also\ you\ can\ get\ library\ of\ python\ for\ flutter\ also\ \:\&nbsp\;\Python package for Flutter

Avatar
Discard
Related Posts Replies Views Activity
2
Jul 24
942
1
Jun 24
3563
1
Oct 23
8590
1
Oct 23
97
1
Aug 23
2192