Hi,
i want to fetch my table account.move.line depending on the value provided from the form.
so normally I have to do this:
"
domains = [('
partner_id
', '=', 'self.partener_id.id'), ('
account_id
', '=', 'self.account_id.id'),]
moves = self.env['account.move.line'].search(domains)
"
But now, having two (02) parameter in domain is not required, so i can have 0, or 1, 0r 2 parameter depending if i filled the imput form partener_id and account_id
so this is what i tried:
"
if rec. partner_id .id != False:
domains += "('partner_id', '=', '" + str(rec. partner_id .id) + "'),"
if rec. account_id .id != False:
domains += "('account_id', '=', '" + str(rec. account_id .id) + "'),"
moves = self.env['account.move.line'].search([domains])
"
but this return the following error:
ValueError: Invalid leaf ('partner_id', '=', '8'),('account_id', '=', '2'),
How can i fix it?
make sure that the fields are in the corresponding models.
also you can refer this: https://www.youtube.com/watch?v=dq5Vtj_pwuI
500: Internal Server Error