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

code

picking = self.env['stock.picking'].sudo().create(pick)            
for line in self:
 move = {
 'name': picking.name,
 'product_id': line.product_id.id,
 'product_uom_qty': line.product_qty,
 'product_uom': line.product_id.uom_id.id,
 'location_id': line.source_location.id,
 'location_dest_id': line.destination_location.id,
 'picking_id': picking.id,
 'company_id': line.source_location.company_id.id,
 }
 self.env['stock.move'].sudo().create(move)

Error

The requested operation cannot be processed because of a programming error setting the `product_qty` field instead of the `product_uom_qty`.


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Just like error says, you should use "product_qty" field instead of "product_uom_qty" to create the stock moves.

Just change the field in your dictionary and try that. I am sure, it will work.

อวตาร
ละทิ้ง
ผู้เขียน

I tried it's not working.

ผู้เขียน

I used same code in another class it's working there

คำตอบที่ดีที่สุด

this answer solved the problem.
>
 Just change readonly become 1 in field "product_qty" inside view_picking_form or inherited from stock.view_picking_form. It caused by compute from _set_product_qty

>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Just change readonly become 1 in field "product_qty" inside view_picking_form or inherited from stock.view_picking_form. It caused by compute from _set_product_qty

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Odoo Mail Sending Limit แก้ไขแล้ว
2
ธ.ค. 23
14751
0
ต.ค. 23
33
3
ต.ค. 23
788
1
ต.ค. 23
569
1
ส.ค. 23
2481