Skip to Content
Menú
This question has been flagged
2 Respostes
3389 Vistes

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
Descartar
Autor 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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
1
de des. 23
2049
0
d’ag. 21
9077
0
de jul. 25
516
2
de set. 22
4086
0
d’ag. 19
6535