Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4914 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
giu 15
4969
1
mar 15
4728
1
gen 22
8415
1
lug 16
24562
0
giu 16
3807