Skip to Content
Menu
This question has been flagged
1 Atsakyti
4760 Rodiniai

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?


Portretas
Atmesti
Best Answer

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


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
birž. 15
4830
1
kov. 15
4596
1
saus. 22
8283
1
liep. 16
24377
0
birž. 16
3714