Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
3392 Vizualizări

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

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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!

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
dec. 23
2052
0
aug. 21
9080
0
iul. 25
521
2
sept. 22
4087
0
aug. 19
6536