コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4778 ビュー

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?


アバター
破棄
最善の回答

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


アバター
破棄
関連投稿 返信 ビュー 活動
2
6月 15
4847
1
3月 15
4603
1
1月 22
8294
1
7月 16
24390
0
6月 16
3723