Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
16193 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
8
พ.ค. 24
48523
Creating custom log file and .txt file? แก้ไขแล้ว
1
ม.ค. 20
5037
Line Spacing in Odoo 17 แก้ไขแล้ว
2
ธ.ค. 24
2414
Odoo Mail Sending Limit แก้ไขแล้ว
2
ธ.ค. 23
14751
0
ต.ค. 23
33