This question has been flagged
1 Reply
5182 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