İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
3288 Görünümler

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
Vazgeç
Üretici En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Ara 23
1952
0
Ağu 21
9002
0
Tem 25
238
2
Eyl 22
4016
0
Ağu 19
6438