Skip to content

Commit

Permalink
Merge a95de25 into c084b4a
Browse files Browse the repository at this point in the history
  • Loading branch information
pyves committed Aug 6, 2019
2 parents c084b4a + a95de25 commit 43bef67
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 61 deletions.
2 changes: 1 addition & 1 deletion account_financial_report_qweb/__manifest__.py
Expand Up @@ -16,7 +16,7 @@
"website": "https://odoo-community.org/",
'depends': [
'account',
'account_group', # account-financial-tools
'account_group', # account-financial-tools
'date_range',
'report_xlsx',
'report',
Expand Down
Expand Up @@ -88,7 +88,7 @@ msgid "Account at 0 filter"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:95
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:97
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:66
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_filters
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_open_items_qweb_filters
Expand Down Expand Up @@ -265,7 +265,7 @@ msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/aged_partner_balance_xlsx.py:132
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:92
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:94
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:64
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:113
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_aged_partner_balance_filters
Expand All @@ -278,7 +278,7 @@ msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/aged_partner_balance_xlsx.py:131
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:91
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:93
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:64
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:112
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_aged_partner_balance_filters
Expand All @@ -296,7 +296,7 @@ msgid "Amount Currency"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:72
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:74
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_lines
#, python-format
msgid "Amount cur."
Expand Down Expand Up @@ -393,7 +393,7 @@ msgid "Centralize"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:99
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:101
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_filters
#, python-format
msgid "Centralize filter"
Expand All @@ -405,7 +405,7 @@ msgid "Centralized"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger.py:1434
#: code:addons/account_financial_report_qweb/report/general_ledger.py:1451
#, python-format
msgid "Centralized Entries"
msgstr ""
Expand Down Expand Up @@ -481,7 +481,7 @@ msgid "Cost\n"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:34
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:36
#: model:ir.model.fields,field_description:account_financial_report_qweb.field_report_general_ledger_qweb_move_line_cost_center
#, python-format
msgid "Cost center"
Expand Down Expand Up @@ -550,7 +550,7 @@ msgid "Created on"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:51
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:53
#: code:addons/account_financial_report_qweb/report/journal_report_xlsx.py:73
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:35
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:76
Expand Down Expand Up @@ -609,14 +609,14 @@ msgid "Cumul older"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:58
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:60
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_lines
#, python-format
msgid "Cumul. Bal."
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:67
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:69
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:43
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:50
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:91
Expand Down Expand Up @@ -735,7 +735,7 @@ msgid "Date range"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:86
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:88
#: code:addons/account_financial_report_qweb/report/journal_report_xlsx.py:175
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:109
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_filters
Expand All @@ -754,7 +754,7 @@ msgid "Date to"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:44
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:46
#: code:addons/account_financial_report_qweb/report/journal_report_xlsx.py:67
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:31
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:72
Expand Down Expand Up @@ -851,7 +851,7 @@ msgid "Ending\n"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:190
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:192
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:122
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:43
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:58
Expand Down Expand Up @@ -1051,7 +1051,7 @@ msgid "From:"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:87
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:89
#: code:addons/account_financial_report_qweb/report/journal_report_xlsx.py:176
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:110
#, python-format
Expand Down Expand Up @@ -1114,7 +1114,7 @@ msgid "Group option"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:96
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:98
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:67
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:115
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_filters
Expand Down Expand Up @@ -1203,7 +1203,7 @@ msgid "Initial\n"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:178
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:180
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:27
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:54
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:68
Expand Down Expand Up @@ -1494,9 +1494,9 @@ msgid "Name"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:100
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:104
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:108
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:102
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:106
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:110
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:69
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:117
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_filters
Expand Down Expand Up @@ -1524,10 +1524,10 @@ msgid "No limit"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger.py:756
#: code:addons/account_financial_report_qweb/report/general_ledger.py:1138
#: code:addons/account_financial_report_qweb/report/open_items.py:306
#: code:addons/account_financial_report_qweb/report/open_items.py:555
#: code:addons/account_financial_report_qweb/report/general_ledger.py:766
#: code:addons/account_financial_report_qweb/report/general_ledger.py:1149
#: code:addons/account_financial_report_qweb/report/open_items.py:313
#: code:addons/account_financial_report_qweb/report/open_items.py:562
#, python-format
msgid "No partner allocated"
msgstr ""
Expand Down Expand Up @@ -1608,6 +1608,14 @@ msgstr ""
msgid "Open items id"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:32
#: model:ir.model.fields,field_description:account_financial_report_qweb.field_report_general_ledger_qweb_move_line_opposite_accounts
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_lines
#, python-format
msgid "Opposite accounts"
msgstr ""

#. module: account_financial_report_qweb
#: model:ir.ui.view,arch_db:account_financial_report_qweb.journal_report_wizard_form_view
msgid "Options"
Expand All @@ -1628,7 +1636,7 @@ msgstr ""
#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/aged_partner_balance_xlsx.py:25
#: code:addons/account_financial_report_qweb/report/aged_partner_balance_xlsx.py:74
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:32
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:34
#: code:addons/account_financial_report_qweb/report/journal_report_xlsx.py:52
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:28
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:67
Expand All @@ -1654,7 +1662,7 @@ msgid "Partner\n"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:175
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:177
#, python-format
msgid "Partner Initial balance"
msgstr ""
Expand All @@ -1666,7 +1674,7 @@ msgid "Partner cumul aged balance"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:187
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:189
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:118
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_ending_cumul
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_open_items_qweb_ending_cumul
Expand Down Expand Up @@ -1759,7 +1767,7 @@ msgid "Posted"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:40
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:42
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_lines
#, python-format
msgid "Rec."
Expand All @@ -1783,7 +1791,7 @@ msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/aged_partner_balance_xlsx.py:75
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:33
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:35
#: code:addons/account_financial_report_qweb/report/journal_report_xlsx.py:57
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:29
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_journal_qweb_journal_table_header
Expand Down Expand Up @@ -1878,7 +1886,7 @@ msgid "Sequence"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:96
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:98
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:67
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:115
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_filters
Expand All @@ -1889,7 +1897,7 @@ msgid "Show"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:103
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:105
#: model:ir.model.fields,field_description:account_financial_report_qweb.field_general_ledger_report_wizard_show_analytic_tags
#: model:ir.model.fields,field_description:account_financial_report_qweb.field_report_general_ledger_qweb_show_analytic_tags
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_filters
Expand All @@ -1903,7 +1911,7 @@ msgid "Show cost center"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:107
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:109
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:68
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:116
#: model:ir.model.fields,field_description:account_financial_report_qweb.field_general_ledger_report_wizard_foreign_currency
Expand Down Expand Up @@ -1941,7 +1949,7 @@ msgid "Start date"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:37
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:39
#: model:ir.model.fields,field_description:account_financial_report_qweb.field_report_general_ledger_qweb_move_line_tags
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_lines
#, python-format
Expand All @@ -1958,7 +1966,7 @@ msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/aged_partner_balance_xlsx.py:130
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:90
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:92
#: code:addons/account_financial_report_qweb/report/journal_report_xlsx.py:179
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:63
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:111
Expand Down Expand Up @@ -2146,9 +2154,9 @@ msgid "With account name"
msgstr ""

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:100
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:104
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:108
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:102
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:106
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:110
#: code:addons/account_financial_report_qweb/report/open_items_xlsx.py:69
#: code:addons/account_financial_report_qweb/report/trial_balance_xlsx.py:117
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_filters
Expand Down
8 changes: 8 additions & 0 deletions account_financial_report_qweb/i18n/fr.po
Expand Up @@ -1670,6 +1670,14 @@ msgstr "Écritures non léttrées XLSX"
msgid "Open items id"
msgstr "Open items id"

#. module: account_financial_report_qweb
#: code:addons/account_financial_report_qweb/report/general_ledger_xlsx.py:32
#: model:ir.model.fields,field_description:account_financial_report_qweb.field_report_general_ledger_qweb_move_line_opposite_accounts
#: model:ir.ui.view,arch_db:account_financial_report_qweb.report_general_ledger_lines
#, python-format
msgid "Opposite accounts"
msgstr "Contreparties"

#. module: account_financial_report_qweb
#: model:ir.ui.view,arch_db:account_financial_report_qweb.journal_report_wizard_form_view
msgid "Options"
Expand Down
25 changes: 21 additions & 4 deletions account_financial_report_qweb/report/general_ledger.py
Expand Up @@ -203,6 +203,7 @@ class GeneralLedgerReportMoveLine(models.TransientModel):
cumul_balance = fields.Float(digits=(16, 2))
currency_id = fields.Many2one(comodel_name='res.currency')
amount_currency = fields.Float(digits=(16, 2))
opposite_accounts = fields.Char()


class GeneralLedgerReportCompute(models.TransientModel):
Expand Down Expand Up @@ -395,7 +396,7 @@ def _inject_account_values(self):
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,
Expand Down Expand Up @@ -436,6 +437,14 @@ def _inject_account_values(self):
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
Expand All @@ -458,7 +467,7 @@ def _inject_account_values(self):
):
query_inject_account += """
GROUP BY
a.id
a.id, t.value
"""
query_inject_account += """
),
Expand Down Expand Up @@ -567,6 +576,7 @@ def _inject_account_values(self):
tuple(self.filter_analytic_tag_ids.ids),
)
query_inject_account_params += (
self.env.user.lang,
self.company_id.id,
self.unaffected_earnings_account.id,
)
Expand Down Expand Up @@ -1080,7 +1090,8 @@ def _inject_line_not_centralized_values(
credit,
cumul_balance,
currency_id,
amount_currency
amount_currency,
opposite_accounts
)
SELECT
"""
Expand Down Expand Up @@ -1169,7 +1180,13 @@ def _inject_line_not_centralized_values(
"""
query_inject_move_line += """
c.id AS currency_id,
ml.amount_currency
ml.amount_currency,
(SELECT string_agg(DISTINCT oa.code, ', ')
FROM account_move_line oml
INNER JOIN account_account oa
ON oml.account_id = oa.id
WHERE oml.move_id = ml.move_id
AND sign(oml.balance) != sign(ml.balance)) AS opposite_accounts
FROM
"""
if is_account_line:
Expand Down

0 comments on commit 43bef67

Please sign in to comment.