Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
5146 Tampilan

Hello,

I want to reduce a field value in template like when i use field number with this format ${object.number} it return whole of number, well i want to reduce it from first and last characters, so any one know how to do this?


Avatar
Buang
Jawaban Terbai

You can create a method in the object to do so and call it from the template.

@api.multi
def get_number(self)
# Now you can use any python function
return self.number[1:-1] # Get numbers except first and last


${objeect.get_number()}


Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Jun 15
5217
1
Mar 15
4913
1
Jan 22
8578
1
Jul 16
24786
0
Jun 16
3999