Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
Câu hỏi đã đóng với nguyên nhân: Question / Code not indented
bởi Kabir Khan trên 06/07/2024 07:16:07
2 Trả lời
1510 Lượt xem
i have custom module of creating a sale order and validate delivery challan this is my code

 new_sale_order.action_confirm()

if new_sale_order.picking_ids:
for picking in new_sale_order.picking_ids:
print('picking', picking)
print('picking.id', picking.id)
if picking.state not in ('done', 'cancel'):
# picking.action_confirm()
# picking.action_assign()
try:
picking.button_validate()
print(f'Successfully validated picking with ID {picking.id}')
except Exception as e:
print(f'Error validating picking with ID {picking.id}: {e}')


error	

picking stock.picking(145,)

fol.id

ERROR: operator does not exist: integer = boolean

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,
The problem is in the line "move_line.product_uom_qty", here move_line is referring to stock.move.line model and there is no field named product_uom_qty, so you have to verify the written code and change it to the correct field from stock.move.line

Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

simply i just wanted to hit validate action please help

Câu trả lời hay nhất

Hi,

The error is caused because stock.move.line does not have a product_uom_qty attribute directly. Instead of using 'move_line.qty_done = move_line.product_uom_qty', you can access the product_uom_qty through the associated move_id field using 'move_line.qty_done = move_line.move_id.product_uom_qty'.


Hope it helps

Ảnh đại diện
Huỷ bỏ
Tác giả

can i skip these two lines i just want to validte delivery challan but it can't work can you please provide solution how i manage

new_sale_order.action_confirm()
this line confirm my sale order check my update question

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 24
1396
0
thg 3 24
1075
3
thg 7 25
2054
1
thg 6 25
2429
2
thg 5 25
2018