Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Using JQuery to trigger onchange method in Odoo 7

By
Adam OConnor
on 9/22/14, 12:03 PM 1,644 views

I would like to use a barcode scanner to receive in products without having to cursor into a field and lookup the product.  I simply want Odoo to recognize that when a string of 12 characters (barcode) within a very short time frame is entered, an onchange event will be triggered to do a product query and populate my product based on the barcode.

Can anyone point me to an existing JQuery class or method that could handle this kind of quick lookup with no interaction without cursoring in to a field to trigger an onchange method.

Adam

0

Ben Bernard

--Ben Bernard--
1083
| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 9/22/14, 11:39 PM

Odoo implement onchange method in server side, cmiiw. It means that the method is not available in javascript, but you can call it if you want by using rpc calls [1]. With this method you still have to query the model (at least twice, compare to just one query to get the products) which means the tradeoff is not really worth it.

 

[1] https://doc.odoo.com/trunk/web/rpc/

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/22/14, 12:03 PM
Seen: 1644 times
Last updated: 3/16/15, 8:10 AM