This question has been flagged
2 Replies
2341 Views

Hello everyone !


I'm trying to show in the POS view, under the client name next to the keypad, if the client has an active membership or not.

I've tried modifying the view, but the POS works offline with JavaScript too.


How can I do that ? What code should I add and where ?

The current Odoo is 10.0 self-hosted with Docker.


Thank you very much for your answers !


Luca

Avatar
Discard
Author Best Answer

Hello Parth !


Thank you very much for your answer! However, I don't know what file and where I should add the modifications ?


i don't know if I'm asking too much, but is it possible for you to make a small tutorial with more details ?

And again, thank you for looking at my problem :)


Luca

Avatar
Discard
Best Answer

Hello Luca,


Yes, you are right, POS Work also in Offline Mode, So you should avoid the RPC Calls. For that, you can do something like this in js.


var models = require('point_of_sale.models');
models.load_fields('res.partner','isMember');
client_details = this.pos.get_client();


Line-2 : You need to load your Membership field (i guess it will be in res.partner model), this will happen once the pos session will be start.

Line-3 : Now when you access the data of selected Client you will get your Newly added field in the dictionary (ex: isMember).


Hope this helps you. Thanks!

Avatar
Discard