And how hard would be such implementation? Right now if you create a new product while the point of sale is open it doesn't recognize the product, so i'm considering doing some code to make the point of sale continuosly look for new products WHILE it is working. Thanks in advance!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
Felt like this warranted an answer, rather than a comment.
First, in screens.js, in the finishOrder function, add this line after the destroy() call that's already there:
$.when(this.pos.load_server_data());
This will cause the program to wait until the server data is all loaded before continuing. This kills the null errors, but causes a few quirks. The first and most annoying is that the categories get added in again whenever you make a new order, so go into db.js, and find the add_categories function. At the top of the function (Just after the self declaration) add this:
this.category_childs = {};
To reset them. Another problem is that the view doesn't refresh automatically. After you go to the products page, there will be a bit of a delay, a loading circle, and then you'll still be on the same page. This solution is a bit of a hackjob, but I'll update it if I find a more elegant solution.
First step is find every line of "this.product_categories_widget" and replace it with "this.pos.product_categories_widget" This will let us find the widget through the pos object in the FinishOrder button. There, replace your finishOrder function with this one:
finishOrder: function() {
var self = this;
this.pos.get('selectedOrder').destroy();
$.when(this.pos.load_server_data())
.done(function() {
self.pos.product_categories_widget.reset_category();
}).fail(function() {
});
},
There's still a gap between making a sale and the view updating, but it will refresh with no button presses from you, and you're ready to sell again right away. As fast as I tried, I couldn't "beat" the loading with a new sale, so that might be a problem with the solution, but it should reload properly every time in normal use.
From Matthew to Matthew, thanks very much! I'm terribly sorry for taking so long for marking this brilliant suggestion as an answer, this is a very good solution. I tottaly forgot my profile here after a few delusions, now faith in help.openerp is restored!
Hi matheus,
Write this this.pos = new module.PosModel(this.session);
line on Next Order
button click code it will fetch newly added Products, Partners for next order.
Hi swapnil, it's a brilliant idea! And for me as it looks it would work right away, but guess i must be doing something wrong.. you're talking about the screen.js file right? My line after the modification looks like this
> click: function() { self.finishOrder(); this.pos = new module.PosModel(this.session); },
But it's not doing anything, i've trying all kinds of syntax variations.. is this working for you? Thanks a lot for your help!
Hi Matheus,
You just write the code on wrong place there is method finishOrder() just below the click: function() { self.finishOrder();}, this put the code this.pos = new module.PosModel(this.session); in that function... Hope this will work for you
Cheers, swapnil
I've made the correction now it looks like this: finishOrder: function() { this.pos.get('selectedOrder').destroy(); this.pos = new module.PosModel(this.session); }, BUT i get this error whenenever i press any button on the screen 'Uncaught Error: QWeb2 - template['PosTicket']: Runtime Error: TypeError: Cannot read property 'attributes' of null' and still it's not loading recently add products.. any suggestion swapnil?
If you're still around, I am also having trouble getting your code to work. Getting the same error.
Okay, so, I've done more research, and even though I haven't gotten it working, maybe if I post my findings it could help you.
The problem is in the loading of the database. The program keeps running while it waits for the data to load, so when it reloads the XML file, there's no data. I've tried to block the function until it's done loading, then manually reload the XML file, but I've been unsuccessful. I'm not sure how to wait on making the POS object, as it doesn't return a deferred, but calls a function that does. I need to do more research on asynchronous javascript.
Hello !
It is possible to update product list but we have to reload it manually.
As you can see in attached image, we are updating Quantity on Hand run time after completion of order process.
Thanks,
Acespritech Solutions Pvt. Ltd.
www.acespritech.com
Blog: acespritechblog.wordpress.com
Mail: info@acespritech.com
Skype: acespritech
Gtalk: acespritech
I see you guys post on a bunch of different questions but you never seem to explain how to do anything. You just direct people to your blog which pretty much says "we did this" but you don't post code or anything. I get that you guys figured out how to solve this problem, but it's not really helping us with the same problem, now is it?
Hi swapnil, it's a brilliant idea! And for me as it looks it would work right away, but guess i must be doing something wrong.. you're talking about the screen.js file right? My line after the modification looks like this
click: function() { self.finishOrder(); this.pos = new module.PosModel(this.session); },
But it's not doing anything, i've trying all kinds of syntax variations.. is this working for you? Thanks a lot for your help!
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Mar 15
|
5477 | ||
|
1
Nov 22
|
1626 | ||
|
0
Jun 22
|
1845 | ||
|
0
Jul 15
|
5323 | ||
|
1
Mar 15
|
3713 |
It could probably be done but I can't help asking myself how common of a use case it is. Do the benefits warrant the added complexity/risk of bugs? How often do you introduce new products while your POS terminals are active? But, then again, I could be wrong.
Grazie mille per la attenzione Lorenzo.. and yes the benefits exceeds the risks involved, this is more a need than a desire actually. Please I don't say this in a arrogant way, but I know quite a lot of business owners like me so i can confidentelly say that this is necessary. Most stores receives products on a daily basis and if there's a way, at least a kickstart on how to update the current products on the point of sale without having to refresh the page I would gladly try to develop such feature and in the future share with the community. Thanks again!