콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
5 답글
11966 화면

I would like to use the following field in PDF invoice report:

<span t-field="l.quantity">

which displays the quantity.

In our particular deployment there is only integer values for quantities. How can I display quantities using without displaying decimal places?


아바타
취소
작성자 베스트 답변

I found the answer somewhere on the internet. I do not know if this is documented somewhere or not:

<span  t-esc="int(l['quantity'])"> 
아바타
취소
베스트 답변

There is a much easier way to change this in Odoo 8.

Go to Settings -> Technical -> Decimal Accuracy -> Product UoS (aka Product Quantity) -> *Change Digits to 0

This solution also pulls through to reports/PDF

아바타
취소

I agree. Much better to do it in Odoo config which will pull through the entire system.

베스트 답변

I found the answer. It's working fine.

<span t-esc="'%.0f'%(l.quantity)"/>

아바타
취소
베스트 답변

In Odoo 11.0 it will be :

<span t-esc="'%.0f'% l.quantity "/>
아바타
취소
관련 게시물 답글 화면 활동
3
12월 24
4884
2
6월 23
4694
0
3월 22
2556
0
8월 21
5229
0
4월 18
8717