Odoo ValueError(“Expected singleton: %s” % self)
Sambil testing data di Odoo, saya mendapatkan galat seperti ini :
1 2 3 |
File "/usr/lib/python3/dist-packages/odoo/models.py", line 4371, in ensure_one raise ValueError("Expected singleton: %s" % self) ValueError: Expected singleton: stock.move(32898, 32899, 32900) |
Solusi:
Mencoba dengan iterasi for loop
1 2 3 |
for record in self: if record.doctype is # First check if entered value is valid |
Kodingan sebelumnya
1 2 3 |
@api.multi def create_product_stock_move_line(self): if not self.move_line_ids: |
Kodingan yang benar
1 2 3 4 |
@api.multi def create_product_stock_move_line(self): for record in self: if not record.move_line_ids: |
Dilihat sebanyak : 1720 kali
Solved. terima kasih mas