Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
5305 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
2
juin 15
5405
1
mars 15
5115
1
janv. 22
8778
1
juil. 16
25039
0
juin 16
4139