Pierre-Yves Berger
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
36 additions and
6 deletions
-
account_financial_report_qweb/report/general_ledger.py
-
account_financial_report_qweb/report/journal_report.py
-
account_financial_report_qweb/report/open_items.py
-
account_financial_report_qweb/report/trial_balance.py
|
|
@ -400,7 +400,7 @@ WITH |
|
|
|
SELECT |
|
|
|
a.id, |
|
|
|
a.code, |
|
|
|
a.name, |
|
|
|
coalesce(t.value, a.name) AS name, |
|
|
|
a.internal_type IN ('payable', 'receivable') |
|
|
|
AS is_partner_account, |
|
|
|
a.user_type_id, |
|
|
@ -441,6 +441,14 @@ WITH |
|
|
|
atml.account_analytic_tag_id = aat.id |
|
|
|
AND aat.id IN %s |
|
|
|
""" |
|
|
|
query_inject_account += """ |
|
|
|
LEFT JOIN |
|
|
|
ir_translation t |
|
|
|
ON |
|
|
|
a.id = t.res_id |
|
|
|
AND t.name = 'account.account,name' |
|
|
|
AND t.lang = %s |
|
|
|
""" |
|
|
|
query_inject_account += """ |
|
|
|
WHERE |
|
|
|
a.company_id = %s |
|
|
@ -463,7 +471,7 @@ WITH |
|
|
|
): |
|
|
|
query_inject_account += """ |
|
|
|
GROUP BY |
|
|
|
a.id |
|
|
|
a.id, t.value |
|
|
|
""" |
|
|
|
query_inject_account += """ |
|
|
|
), |
|
|
@ -572,6 +580,7 @@ AND |
|
|
|
tuple(self.filter_analytic_tag_ids.ids), |
|
|
|
) |
|
|
|
query_inject_account_params += ( |
|
|
|
self.env.user.lang, |
|
|
|
self.company_id.id, |
|
|
|
self.unaffected_earnings_account.id, |
|
|
|
) |
|
|
|
|
|
@ -291,7 +291,7 @@ class ReportJournalQweb(models.TransientModel): |
|
|
|
rjqm.id as report_move_id, |
|
|
|
aml.id as move_line_id, |
|
|
|
aml.account_id as account_id, |
|
|
|
aa.name as account, |
|
|
|
coalesce(t.value, aa.name) as account, |
|
|
|
aa.code as account_code, |
|
|
|
aa.internal_type as account_type, |
|
|
|
aml.partner_id as partner_id, |
|
|
@ -336,6 +336,12 @@ class ReportJournalQweb(models.TransientModel): |
|
|
|
LEFT JOIN |
|
|
|
account_account aa |
|
|
|
on (aa.id = aml.account_id) |
|
|
|
LEFT JOIN |
|
|
|
ir_translation t |
|
|
|
ON |
|
|
|
aa.id = t.res_id |
|
|
|
AND t.name = 'account.account,name' |
|
|
|
AND t.lang = %s |
|
|
|
LEFT JOIN |
|
|
|
res_partner p |
|
|
|
on (p.id = aml.partner_id) |
|
|
@ -350,6 +356,7 @@ class ReportJournalQweb(models.TransientModel): |
|
|
|
""" |
|
|
|
params = ( |
|
|
|
self.env.uid, |
|
|
|
self.env.user.lang, |
|
|
|
self.id, |
|
|
|
) |
|
|
|
self.env.cr.execute(sql, params) |
|
|
|
|
|
@ -205,13 +205,19 @@ WITH |
|
|
|
SELECT |
|
|
|
a.id, |
|
|
|
a.code, |
|
|
|
a.name, |
|
|
|
coalesce (t.value, a.name) AS name, |
|
|
|
a.user_type_id, |
|
|
|
c.id as currency_id |
|
|
|
FROM |
|
|
|
account_account a |
|
|
|
INNER JOIN |
|
|
|
account_move_line ml ON a.id = ml.account_id AND ml.date <= %s |
|
|
|
LEFT JOIN |
|
|
|
ir_translation t |
|
|
|
ON |
|
|
|
a.id = t.res_id |
|
|
|
AND t.name = 'account.account,name' |
|
|
|
AND t.lang = %s |
|
|
|
LEFT JOIN |
|
|
|
res_currency c ON a.currency_id = c.id |
|
|
|
""" |
|
|
@ -242,7 +248,7 @@ WITH |
|
|
|
""" |
|
|
|
query_inject_account += """ |
|
|
|
GROUP BY |
|
|
|
a.id, c.id |
|
|
|
a.id, c.id, t.value |
|
|
|
) |
|
|
|
INSERT INTO |
|
|
|
report_open_items_qweb_account |
|
|
@ -268,6 +274,7 @@ FROM |
|
|
|
""" |
|
|
|
query_inject_account_params = ( |
|
|
|
self.date_at, |
|
|
|
self.env.user.lang, |
|
|
|
self.company_id.id, |
|
|
|
) |
|
|
|
if self.filter_account_ids: |
|
|
|
|
|
@ -300,7 +300,7 @@ SELECT |
|
|
|
acc.id, |
|
|
|
acc.group_id, |
|
|
|
acc.code, |
|
|
|
acc.name, |
|
|
|
coalesce(t.value, acc.name) AS name, |
|
|
|
coalesce(rag.initial_balance, 0) AS initial_balance, |
|
|
|
coalesce(rag.final_debit - rag.initial_debit, 0) AS debit, |
|
|
|
coalesce(rag.final_credit - rag.initial_credit, 0) AS credit, |
|
|
@ -315,6 +315,12 @@ FROM |
|
|
|
account_account acc |
|
|
|
LEFT OUTER JOIN report_general_ledger_qweb_account AS rag |
|
|
|
ON rag.account_id = acc.id AND rag.report_id = %s |
|
|
|
LEFT JOIN |
|
|
|
ir_translation t |
|
|
|
ON |
|
|
|
acc.id = t.res_id |
|
|
|
AND t.name = 'account.account,name' |
|
|
|
AND t.lang = %s |
|
|
|
WHERE |
|
|
|
acc.id in %s |
|
|
|
""" |
|
|
@ -322,6 +328,7 @@ WHERE |
|
|
|
self.id, |
|
|
|
self.env.uid, |
|
|
|
self.general_ledger_id.id, |
|
|
|
self.env.user.lang, |
|
|
|
account_ids._ids, |
|
|
|
) |
|
|
|
self.env.cr.execute(query_inject_account, query_inject_account_params) |
|
|
|