[FIX] account: fixed syntax error for res.company

1. minor mistake, prefix for account move line
instead of line.company_id, use `aml.company_id`
2. syntax error : typecase for `::int =`
to compare parent_path with integer value.

closes odoo/odoo#144764

X-original-commit: 286a911f640351640d60efdf597461055f42f9c5
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Atul Patel (atp) <atp@odoo.com>
This commit is contained in:
Atul Patel
2023-12-04 13:23:46 +00:00
parent e39efcaa52
commit 6151d3381d
+2 -2
View File
@@ -383,11 +383,11 @@ class ResPartner(models.Model):
FROM res_partner partner
LEFT JOIN account_move_line aml ON aml.partner_id = partner.id
JOIN account_move move ON move.id = aml.move_id
JOIN res_company line_company ON line_company.id = line.company_id
JOIN res_company line_company ON line_company.id = aml.company_id
RIGHT JOIN account_account acc ON aml.account_id = acc.id
WHERE acc.account_type = %s
AND NOT acc.deprecated
AND SPLIT_PART(line_company.parent_path, '/', 1):int == %s
AND SPLIT_PART(line_company.parent_path, '/', 1)::int = %s
AND move.state = 'posted'
GROUP BY aml.partner_id
HAVING %s * COALESCE(SUM(aml.amount_residual), 0) {operator} %s''',