Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4785 Widoki

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?


Awatar
Odrzuć
Najlepsza odpowiedź

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()}


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
cze 15
4857
1
mar 15
4606
1
sty 22
8305
1
lip 16
24393
0
cze 16
3729