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

Hi i'm using odoo v12 CE, python3.7 
I get this error when i'm adding a product in sale.order.line, this error is raised when executing the raise message combined with int and string
_('You plan to sell %s %s of %s but you only have %s %s available in %s warehouse.') % \
(self.product_uom_qty, self.product_uom.name, self.product_id.name, product.virtual_available, product.uom_id.name, self.order_id.warehouse_id.name)​

아바타
취소
베스트 답변

We had got the same issue. It came from translation string (the french one in our case) which didn't have the right number of arguments (4 instead of 6).
Just update your Odoo repo, update translation with the 'Overwrite Existing Terms' option checked.

아바타
취소
작성자

Thank you David, absolutly nice, the issue is solved

작성자 베스트 답변

Thank you Vishnu, 
I know that, my question is for the "TypeError: not all arguments converted during string formatting"

아바타
취소
베스트 답변

Hello,

This is actually a warning message for Not enough inventory! . You may adding a product with on hand stock low than ordering qty.

Check Stock of the product while adding in sale order.

아바타
취소
베스트 답변

Hello Firas,

This is because of wrong string formatting passed when you try to raise warning.
Please use this:
('You plan to sell %s %s of %s but you only have %s %s available in %s warehouse.') % \
(str(self.product_uom_qty), self.product_uom.name, self.product_id.name, str(product.virtual_available), product.uom_id.name, self.order_id.warehouse_id.name)​ 

This will format into string.

Hope it helps!

Thanks,
Mayank Gosai

아바타
취소
관련 게시물 답글 화면 활동
8
5월 24
48670
1
1월 20
5185
2
12월 24
2548
2
12월 23
14890
0
10월 23
33