Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
3388 Tampilan

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
Buang
Penulis Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Des 23
2043
0
Agu 21
9074
0
Jul 25
511
2
Sep 22
4085
0
Agu 19
6533