Skip to Content
Menu
This question has been flagged
1 Reply
5387 Views

Code

Error

how i can resolve singleton issue when i have loop with @api.multi

Avatar
Discard

just loop through on your object "your.model(1,2,3)"

Best Answer

Hi,

The issue is in the line,

spObj =self.env['social.approval'].search([('booking_id', '=', rec.id)])

From the above code you are getting multiple records to the variable spObj, so you have to iterate the spObj over a for loop or give limit=1, along with search.

spObj =self.env['social.approval'].search([('booking_id', '=', rec.id)], limit=​1)

or

spObj =self.env['social.approval'].search([('booking_id', '=', rec.id)], limit=​1)

for obj in spObj:

for obj.special_approval_line_ids


Like this update the code and see.

Thanks

Avatar
Discard
Related Posts Replies Views Activity
4
Apr 17
3099
0
Sep 24
384
0
Apr 24
361
0
Apr 24
93
4
Mar 24
298