[IMP] account_financial_reports: Several improvements:

* Move to less files to compile variables
* hide contacts on partner
* Add reports to res partner actions
* initialize wizard from context
* initialize wizard by current fiscal year
pull/868/head
Iryna Vushnevska 2019-01-28 02:06:36 +02:00 committed by Jasmin Solanki
parent 66be912a07
commit c28af38dd9
26 changed files with 436 additions and 185 deletions

View File

@ -1124,6 +1124,7 @@ msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1678,6 +1679,11 @@ msgstr ""
msgid "Open Items -" msgid "Open Items -"
msgstr "" msgstr ""
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
msgid "Open Items Partner"
msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2157,13 +2163,13 @@ msgid "Taxtags"
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "The Company in the General Ledger Report Wizard and in Date Range must be the same." msgid "The Company in the General Ledger Report Wizard and in Date Range must be the same."
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "The Company in the Trial Balance Report Wizard and in Date Range must be the same." msgid "The Company in the Trial Balance Report Wizard and in Date Range must be the same."
msgstr "" msgstr ""

View File

@ -1144,6 +1144,7 @@ msgstr "تاريخ بدء السنة المالية"
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1711,6 +1712,12 @@ msgstr "دفعات مستحقّة"
msgid "Open Items -" msgid "Open Items -"
msgstr "دفعات مستحقّة" msgstr "دفعات مستحقّة"
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
#, fuzzy
msgid "Open Items Partner"
msgstr "دفعات مستحقّة"
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2193,7 +2200,7 @@ msgid "Taxtags"
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2201,7 +2208,7 @@ msgid ""
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1144,6 +1144,7 @@ msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1703,6 +1704,11 @@ msgstr ""
msgid "Open Items -" msgid "Open Items -"
msgstr "" msgstr ""
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
msgid "Open Items Partner"
msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2186,7 +2192,7 @@ msgid "Taxtags"
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2194,7 +2200,7 @@ msgid ""
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1166,6 +1166,7 @@ msgstr "GJ Beginn"
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1729,6 +1730,13 @@ msgstr "Offene Posten"
msgid "Open Items -" msgid "Open Items -"
msgstr "Offene Posten -" msgstr "Offene Posten -"
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
#, fuzzy
#| msgid "Open Items -"
msgid "Open Items Partner"
msgstr "Offene Posten -"
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2218,7 +2226,7 @@ msgid "Taxtags"
msgstr "Steuer-Stichwörter" msgstr "Steuer-Stichwörter"
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2228,7 +2236,7 @@ msgstr ""
"identisch sein." "identisch sein."
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1159,6 +1159,7 @@ msgstr "Fecha Inicio"
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1724,6 +1725,13 @@ msgstr "Partidas abiertas"
msgid "Open Items -" msgid "Open Items -"
msgstr "Partidas abiertas -" msgstr "Partidas abiertas -"
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
#, fuzzy
#| msgid "Open Items -"
msgid "Open Items Partner"
msgstr "Partidas abiertas -"
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2205,7 +2213,7 @@ msgid "Taxtags"
msgstr "Etiquetas de impuestos" msgstr "Etiquetas de impuestos"
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2215,7 +2223,7 @@ msgstr ""
"fechas debe ser la misma." "fechas debe ser la misma."
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1146,6 +1146,7 @@ msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1705,6 +1706,11 @@ msgstr ""
msgid "Open Items -" msgid "Open Items -"
msgstr "" msgstr ""
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
msgid "Open Items Partner"
msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2189,7 +2195,7 @@ msgid "Taxtags"
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2197,7 +2203,7 @@ msgid ""
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1148,6 +1148,7 @@ msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1707,6 +1708,11 @@ msgstr ""
msgid "Open Items -" msgid "Open Items -"
msgstr "" msgstr ""
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
msgid "Open Items Partner"
msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2191,7 +2197,7 @@ msgid "Taxtags"
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2199,7 +2205,7 @@ msgid ""
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1146,6 +1146,7 @@ msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1711,6 +1712,12 @@ msgstr "Partite aperte"
msgid "Open Items -" msgid "Open Items -"
msgstr "Partite aperte" msgstr "Partite aperte"
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
#, fuzzy
msgid "Open Items Partner"
msgstr "Partite aperte"
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2194,7 +2201,7 @@ msgid "Taxtags"
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2202,7 +2209,7 @@ msgid ""
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1167,6 +1167,7 @@ msgstr "Fj startdatum"
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1740,6 +1741,12 @@ msgstr "Openstaande posten"
msgid "Open Items -" msgid "Open Items -"
msgstr "Openstaande posten" msgstr "Openstaande posten"
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
#, fuzzy
msgid "Open Items Partner"
msgstr "Openstaande posten"
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2226,7 +2233,7 @@ msgid "Taxtags"
msgstr "Belasting labels" msgstr "Belasting labels"
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2234,7 +2241,7 @@ msgid ""
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1147,6 +1147,7 @@ msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1706,6 +1707,11 @@ msgstr ""
msgid "Open Items -" msgid "Open Items -"
msgstr "" msgstr ""
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
msgid "Open Items Partner"
msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2188,7 +2194,7 @@ msgid "Taxtags"
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2196,7 +2202,7 @@ msgid ""
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1146,6 +1146,7 @@ msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1705,6 +1706,11 @@ msgstr ""
msgid "Open Items -" msgid "Open Items -"
msgstr "" msgstr ""
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
msgid "Open Items Partner"
msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2189,7 +2195,7 @@ msgid "Taxtags"
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2197,7 +2203,7 @@ msgid ""
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1156,6 +1156,7 @@ msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:15 #: code:addons/account_financial_report/report/general_ledger_xlsx.py:15
#: model:ir.actions.act_window,name:account_financial_report.act_action_general_ledger_wizard_partner_relation
#: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard #: model:ir.actions.act_window,name:account_financial_report.action_general_ledger_wizard
#: model:ir.actions.client,name:account_financial_report.action_report_general_ledger #: model:ir.actions.client,name:account_financial_report.action_report_general_ledger
#: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html #: model:ir.actions.report,name:account_financial_report.action_report_general_ledger_html
@ -1722,6 +1723,12 @@ msgstr "Poziții deschise"
msgid "Open Items -" msgid "Open Items -"
msgstr "Poziții deschise" msgstr "Poziții deschise"
#. module: account_financial_report
#: model:ir.actions.act_window,name:account_financial_report.act_action_open_items_wizard_partner_relation
#, fuzzy
msgid "Open Items Partner"
msgstr "Poziții deschise"
#. module: account_financial_report #. module: account_financial_report
#: model:ir.model,name:account_financial_report.model_open_items_report_wizard #: model:ir.model,name:account_financial_report.model_open_items_report_wizard
msgid "Open Items Report Wizard" msgid "Open Items Report Wizard"
@ -2205,7 +2212,7 @@ msgid "Taxtags"
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/general_ledger_wizard.py:160 #: code:addons/account_financial_report/wizard/general_ledger_wizard.py:196
#, python-format #, python-format
msgid "" msgid ""
"The Company in the General Ledger Report Wizard and in Date Range must be " "The Company in the General Ledger Report Wizard and in Date Range must be "
@ -2213,7 +2220,7 @@ msgid ""
msgstr "" msgstr ""
#. module: account_financial_report #. module: account_financial_report
#: code:addons/account_financial_report/wizard/trial_balance_wizard.py:163 #: code:addons/account_financial_report/wizard/trial_balance_wizard.py:165
#, python-format #, python-format
msgid "" msgid ""
"The Company in the Trial Balance Report Wizard and in Date Range must be the " "The Company in the Trial Balance Report Wizard and in Date Range must be the "

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>) # Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).-
from odoo import api, models from odoo import api, models

View File

@ -638,6 +638,7 @@ ORDER BY
self._compute_account_cumul() self._compute_account_cumul()
def _compute_partner_cumul(self): def _compute_partner_cumul(self):
# pylint: disable=sql-injection
where_condition_partner_by_account = """ where_condition_partner_by_account = """
WHERE WHERE
id IN id IN

View File

@ -1,54 +1,57 @@
odoo.define('account_financial_report.account_financial_report_backend', function (require) { odoo.define('account_financial_report.account_financial_report_backend', function (require) {
'use strict'; 'use strict';
var core = require('web.core'); var core = require('web.core');
var Widget = require('web.Widget'); var Widget = require('web.Widget');
var ControlPanelMixin = require('web.ControlPanelMixin'); var ControlPanelMixin = require('web.ControlPanelMixin');
var ReportWidget = require('account_financial_report.account_financial_report_widget'); var ReportWidget = require(
'account_financial_report.account_financial_report_widget'
);
var report_backend = Widget.extend(ControlPanelMixin, { var report_backend = Widget.extend(ControlPanelMixin, {
// Stores all the parameters of the action. // Stores all the parameters of the action.
events: { events: {
'click .o_account_financial_reports_print': 'print', 'click .o_account_financial_reports_print': 'print',
'click .o_account_financial_reports_export': 'export', 'click .o_account_financial_reports_export': 'export',
}, },
init: function(parent, action) { init: function (parent, action) {
this.actionManager = parent; this.actionManager = parent;
this.given_context = {}; this.given_context = {};
this.odoo_context = action.context; this.odoo_context = action.context;
this.controller_url = action.context.url; this.controller_url = action.context.url;
if (action.context.context) { if (action.context.context) {
this.given_context = action.context.context; this.given_context = action.context.context;
} }
this.given_context.active_id = action.context.active_id || action.params.active_id; this.given_context.active_id = action.context.active_id ||
this.given_context.model = action.context.active_model || false; action.params.active_id;
this.given_context.ttype = action.context.ttype || false; this.given_context.model = action.context.active_model || false;
return this._super.apply(this, arguments); this.given_context.ttype = action.context.ttype || false;
}, return this._super.apply (this, arguments);
willStart: function() { },
return $.when(this.get_html()); willStart: function () {
}, return $.when(this.get_html());
set_html: function() { },
var self = this; set_html: function () {
var def = $.when(); var self = this;
if (!this.report_widget) { var def = $.when();
this.report_widget = new ReportWidget(this, this.given_context); if (!this.report_widget) {
def = this.report_widget.appendTo(this.$el); this.report_widget = new ReportWidget(this, this.given_context);
} def = this.report_widget.appendTo(this.$el);
def.then(function () { }
self.report_widget.$el.html(self.html); def.then(function () {
}); self.report_widget.$el.html(self.html);
}, });
start: function() { },
this.set_html(); start: function() {
return this._super(); this.set_html();
}, return this._super();
// Fetches the html and is previous report.context if any, else create it },
get_html: function() { // Fetches the html and is previous report.context if any, else create it
var self = this; get_html: function() {
var defs = []; var self = this;
return this._rpc({ var defs = [];
return this._rpc({
model: this.given_context.model, model: this.given_context.model,
method: 'get_html', method: 'get_html',
args: [self.given_context], args: [self.given_context],
@ -59,46 +62,50 @@ var report_backend = Widget.extend(ControlPanelMixin, {
defs.push(self.update_cp()); defs.push(self.update_cp());
return $.when.apply($, defs); return $.when.apply($, defs);
}); });
}, },
// Updates the control panel and render the elements that have yet to be rendered // Updates the control panel and render the elements that have yet
update_cp: function() { // to be rendered
if (this.$buttons) { update_cp: function () {
var status = { if (this.$buttons) {
breadcrumbs: this.actionManager.get_breadcrumbs(), var status = {
cp_content: {$buttons: this.$buttons}, breadcrumbs: this.actionManager.get_breadcrumbs(),
}; cp_content: {$buttons: this.$buttons},
return this.update_control_panel(status); };
} return this.update_control_panel(status);
}, }
do_show: function() { },
this._super(); do_show: function () {
this.update_cp(); this._super();
}, this.update_cp();
print: function() { },
var self = this; print: function () {
this._rpc({ var self = this;
model: this.given_context.model, this._rpc({
method: 'print_report', model: this.given_context.model,
args: [this.given_context.active_id, 'qweb-pdf'], method: 'print_report',
context: self.odoo_context, args: [this.given_context.active_id, 'qweb-pdf'],
}).then(function(result){ context: self.odoo_context,
self.do_action(result); }).then(function(result){
}); self.do_action(result);
}, });
export: function() { },
var self = this; export: function () {
this._rpc({ var self = this;
model: this.given_context.model, this._rpc({
method: 'print_report', model: this.given_context.model,
args: [this.given_context.active_id, 'xlsx'], method: 'print_report',
context: self.odoo_context, args: [this.given_context.active_id, 'xlsx'],
}) context: self.odoo_context,
.then(function(result){ })
self.do_action(result); .then(function(result){
}); self.do_action(result);
}, });
}); },
});
core.action_registry.add("account_financial_report_backend", report_backend); core.action_registry.add(
return report_backend; "account_financial_report_backend",
report_backend
);
return report_backend;
}); });

View File

@ -1,69 +1,73 @@
odoo.define('account_financial_report.account_financial_report_widget', function odoo.define('account_financial_report.account_financial_report_widget', function
(require) { (require) {
'use strict'; 'use strict';
var Widget = require('web.Widget'); var Widget = require('web.Widget');
var accountFinancialReportWidget = Widget.extend({ var accountFinancialReportWidget = Widget.extend({
events: { events: {
'click .o_account_financial_reports_web_action': 'boundLink', 'click .o_account_financial_reports_web_action':
'click .o_account_financial_reports_web_action_multi': 'boundLinkmulti', 'boundLink',
'click .o_account_financial_reports_web_action_monetary': 'boundLinkMonetary', 'click .o_account_financial_reports_web_action_multi':
'click .o_account_financial_reports_web_action_monetary_multi': 'boundLinkMonetarymulti', 'boundLinkmulti',
}, 'click .o_account_financial_reports_web_action_monetary':
init: function() { 'boundLinkMonetary',
this._super.apply(this, arguments); 'click .o_account_financial_reports_web_action_monetary_multi':
}, 'boundLinkMonetarymulti',
start: function() { },
return this._super.apply(this, arguments); init: function () {
}, this._super.apply(this, arguments);
boundLink: function(e) { },
var res_model = $(e.target).data('res-model'); start: function () {
var res_id = $(e.target).data('active-id'); return this._super.apply(this, arguments);
return this.do_action({ },
type: 'ir.actions.act_window', boundLink: function (e) {
res_model: res_model, var res_model = $(e.target).data('res-model');
res_id: res_id, var res_id = $(e.target).data('active-id');
views: [[false, 'form']], return this.do_action({
target: 'current' type: 'ir.actions.act_window',
}); res_model: res_model,
}, res_id: res_id,
boundLinkmulti: function(e) { views: [[false, 'form']],
var res_model = $(e.target).data('res-model'); target: 'current',
var domain = $(e.target).data('domain'); });
return this.do_action({ },
type: 'ir.actions.act_window', boundLinkmulti: function (e) {
res_model: res_model, var res_model = $(e.target).data('res-model');
domain: domain, var domain = $(e.target).data('domain');
views: [[false, "list"], [false, "form"]], return this.do_action({
target: 'current' type: 'ir.actions.act_window',
}); res_model: res_model,
}, domain: domain,
boundLinkMonetary: function(e) { views: [[false, "list"], [false, "form"]],
var res_model = $(e.target.parentElement).data('res-model'); target: 'current',
var res_id = $(e.target.parentElement).data('active-id'); });
return this.do_action({ },
type: 'ir.actions.act_window', boundLinkMonetary: function (e) {
res_model: res_model, var res_model = $(e.target.parentElement).data('res-model');
res_id: res_id, var res_id = $(e.target.parentElement).data('active-id');
views: [[false, 'form']], return this.do_action({
target: 'current' type: 'ir.actions.act_window',
}); res_model: res_model,
}, res_id: res_id,
boundLinkMonetarymulti: function(e) { views: [[false, 'form']],
var res_model = $(e.target.parentElement).data('res-model'); target: 'current',
var domain = $(e.target.parentElement).data('domain'); });
return this.do_action({ },
type: 'ir.actions.act_window', boundLinkMonetarymulti: function (e) {
res_model: res_model, var res_model = $(e.target.parentElement).data('res-model');
domain: domain, var domain = $(e.target.parentElement).data('domain');
views: [[false, "list"], [false, "form"]], return this.do_action({
target: 'current' type: 'ir.actions.act_window',
}); res_model: res_model,
}, domain: domain,
}); views: [[false, "list"], [false, "form"]],
target: 'current',
});
},
});
return accountFinancialReportWidget; return accountFinancialReportWidget;
}); });

View File

@ -493,3 +493,57 @@ class TestGeneralLedgerReport(common.TransactionCase):
self.assertEqual(lines['unaffected'].final_debit, 500) self.assertEqual(lines['unaffected'].final_debit, 500)
self.assertEqual(lines['unaffected'].final_credit, 0) self.assertEqual(lines['unaffected'].final_credit, 0)
self.assertEqual(lines['unaffected'].final_balance, 500) self.assertEqual(lines['unaffected'].final_balance, 500)
def test_partner_filter(self):
partner_1 = self.env.ref('base.res_partner_1')
partner_2 = self.env.ref('base.res_partner_2')
partner_3 = self.env.ref('base.res_partner_3')
partner_4 = self.env.ref('base.res_partner_4')
partner_1.write({'is_company': False,
'parent_id': partner_2.id})
partner_3.write({'is_company': False})
expected_list = [partner_2.id, partner_3.id, partner_4.id]
context = {
'active_ids': [
partner_1.id, partner_2.id, partner_3.id, partner_4.id
],
'active_model': 'res.partner'
}
wizard = self.env["general.ledger.report.wizard"].with_context(context)
self.assertEqual(wizard._default_partners(), expected_list)
def test_validate_date(self):
company_id = self.env.ref('base.main_company')
company_id.write({
'fiscalyear_last_day': 31,
'fiscalyear_last_month': 12,
})
user = self.env.ref('base.user_root').with_context(
company_id=company_id.id)
wizard = self.env["general.ledger.report.wizard"].with_context(
user=user.id
)
self.assertEqual(wizard._init_date_from(),
time.strftime('%Y') + '-01-01')
def test_validate_date_range(self):
data_type = self.env['date.range.type'].create({
'name': 'Fiscal year',
'company_id': False,
'allow_overlap': False
})
dr = self.env['date.range'].create({
'name': 'FS2015',
'date_start': '2018-01-01',
'date_end': '2018-12-31',
'type_id': data_type.id,
})
wizard = self.env["general.ledger.report.wizard"].create({
'date_range_id': dr.id})
wizard.onchange_date_range_id()
self.assertEqual(wizard.date_from, '2018-01-01')
self.assertEqual(wizard.date_to, '2018-12-31')

View File

@ -39,3 +39,23 @@ class TestOpenItems(a_t_f_c.AbstractTestForeignCurrency):
{'hide_account_at_0': True}, {'hide_account_at_0': True},
{'only_posted_moves': True, 'hide_account_at_0': True}, {'only_posted_moves': True, 'hide_account_at_0': True},
] ]
def test_partner_filter(self):
partner_1 = self.env.ref('base.res_partner_1')
partner_2 = self.env.ref('base.res_partner_2')
partner_3 = self.env.ref('base.res_partner_3')
partner_4 = self.env.ref('base.res_partner_4')
partner_1.write({'is_company': False,
'parent_id': partner_2.id})
partner_3.write({'is_company': False})
expected_list = [partner_2.id, partner_3.id, partner_4.id]
context = {
'active_ids': [
partner_1.id, partner_2.id, partner_3.id, partner_4.id
],
'active_model': 'res.partner'
}
wizard = self.env["open.items.report.wizard"].with_context(context)
self.assertEqual(wizard._default_partners(), expected_list)

View File

@ -4,7 +4,7 @@
<template id="account_financial_report_assets_backend" <template id="account_financial_report_assets_backend"
name="account_financial_report assets" inherit_id="web.assets_backend"> name="account_financial_report assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link href="/account_financial_report/static/src/css/report.css" rel="stylesheet"/> <link href="/account_financial_report/static/src/less/report.less" rel="stylesheet"/>
<script type="text/javascript" <script type="text/javascript"
src="/account_financial_report/static/src/js/account_financial_report_backend.js"/> src="/account_financial_report/static/src/js/account_financial_report_backend.js"/>
<script type="text/javascript" <script type="text/javascript"

View File

@ -60,8 +60,10 @@ class AgedPartnerBalanceWizard(models.TransientModel):
res['domain']['account_ids'] += [ res['domain']['account_ids'] += [
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
res['domain']['partner_ids'] += [ res['domain']['partner_ids'] += [
'&',
'|', ('company_id', '=', self.company_id.id), '|', ('company_id', '=', self.company_id.id),
('company_id', '=', False)] ('company_id', '=', False),
('parent_id', '=', False)]
return res return res
@api.onchange('receivable_accounts_only', 'payable_accounts_only') @api.onchange('receivable_accounts_only', 'payable_accounts_only')

View File

@ -11,6 +11,7 @@ from odoo import api, fields, models, _
from odoo.tools.safe_eval import safe_eval from odoo.tools.safe_eval import safe_eval
from odoo.tools import pycompat from odoo.tools import pycompat
from odoo.exceptions import ValidationError from odoo.exceptions import ValidationError
import time
class GeneralLedgerReportWizard(models.TransientModel): class GeneralLedgerReportWizard(models.TransientModel):
@ -29,8 +30,10 @@ class GeneralLedgerReportWizard(models.TransientModel):
comodel_name='date.range', comodel_name='date.range',
string='Date range' string='Date range'
) )
date_from = fields.Date(required=True) date_from = fields.Date(required=True,
date_to = fields.Date(required=True) default=lambda self: self._init_date_from())
date_to = fields.Date(required=True,
default=fields.Date.context_today)
fy_start_date = fields.Date(compute='_compute_fy_start_date') fy_start_date = fields.Date(compute='_compute_fy_start_date')
target_move = fields.Selection([('posted', 'All Posted Entries'), target_move = fields.Selection([('posted', 'All Posted Entries'),
('all', 'All Entries')], ('all', 'All Entries')],
@ -58,6 +61,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
partner_ids = fields.Many2many( partner_ids = fields.Many2many(
comodel_name='res.partner', comodel_name='res.partner',
string='Filter partners', string='Filter partners',
default=lambda self: self._default_partners(),
) )
analytic_tag_ids = fields.Many2many( analytic_tag_ids = fields.Many2many(
comodel_name='account.analytic.tag', comodel_name='account.analytic.tag',
@ -80,9 +84,38 @@ class GeneralLedgerReportWizard(models.TransientModel):
string='Show foreign currency', string='Show foreign currency',
help='Display foreign currency for move lines, unless ' help='Display foreign currency for move lines, unless '
'account currency is not setup through chart of accounts ' 'account currency is not setup through chart of accounts '
'will display initial and final balance in that currency.' 'will display initial and final balance in that currency.',
default=lambda self: self._default_foreign_currency(),
) )
def _init_date_from(self):
"""set start date to begin of current year if fiscal year running"""
today = fields.Date.context_today(self)
cur_month = fields.Date.from_string(today).month
cur_day = fields.Date.from_string(today).day
last_fsc_month = self.env.user.company_id.fiscalyear_last_month
last_fsc_day = self.env.user.company_id.fiscalyear_last_day
if cur_month < last_fsc_month \
or cur_month == last_fsc_month and cur_day <= last_fsc_day:
return time.strftime('%Y-01-01')
def _default_foreign_currency(self):
return self.env.user.has_group('base.group_multi_currency')
def _default_partners(self):
context = self.env.context
if context.get('active_ids') and context.get('active_model') \
== 'res.partner':
partner_ids = context['active_ids']
corp_partners = self.env['res.partner'].browse(partner_ids). \
filtered(lambda p: p.parent_id)
partner_ids = set(partner_ids) - set(corp_partners.ids)
partner_ids |= set(corp_partners.mapped('parent_id.id'))
return list(partner_ids)
@api.depends('date_from') @api.depends('date_from')
def _compute_fy_start_date(self): def _compute_fy_start_date(self):
for wiz in self.filtered('date_from'): for wiz in self.filtered('date_from'):
@ -135,8 +168,10 @@ class GeneralLedgerReportWizard(models.TransientModel):
res['domain']['account_journal_ids'] += [ res['domain']['account_journal_ids'] += [
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
res['domain']['partner_ids'] += [ res['domain']['partner_ids'] += [
'&',
'|', ('company_id', '=', self.company_id.id), '|', ('company_id', '=', self.company_id.id),
('company_id', '=', False)] ('company_id', '=', False),
('parent_id', '=', False)]
res['domain']['cost_center_ids'] += [ res['domain']['cost_center_ids'] += [
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
res['domain']['date_range_id'] += [ res['domain']['date_range_id'] += [
@ -147,8 +182,9 @@ class GeneralLedgerReportWizard(models.TransientModel):
@api.onchange('date_range_id') @api.onchange('date_range_id')
def onchange_date_range_id(self): def onchange_date_range_id(self):
"""Handle date range change.""" """Handle date range change."""
self.date_from = self.date_range_id.date_start if self.date_range_id:
self.date_to = self.date_range_id.date_end self.date_from = self.date_range_id.date_start
self.date_to = self.date_range_id.date_end
@api.multi @api.multi
@api.constrains('company_id', 'date_range_id') @api.constrains('company_id', 'date_range_id')

View File

@ -85,4 +85,17 @@
view_id="general_ledger_wizard" view_id="general_ledger_wizard"
target="new" /> target="new" />
<!--Add to res.partner action-->
<act_window id="act_action_general_ledger_wizard_partner_relation"
name="General Ledger"
res_model="general.ledger.report.wizard"
src_model="res.partner"
view_mode="form"
context="{
'default_receivable_accounts_only':1,
'default_payable_accounts_only':1,
}"
key2="client_action_multi"
target="new" />
</odoo> </odoo>

View File

@ -44,14 +44,32 @@ class OpenItemsReportWizard(models.TransientModel):
partner_ids = fields.Many2many( partner_ids = fields.Many2many(
comodel_name='res.partner', comodel_name='res.partner',
string='Filter partners', string='Filter partners',
default=lambda self: self._default_partners(),
) )
foreign_currency = fields.Boolean( foreign_currency = fields.Boolean(
string='Show foreign currency', string='Show foreign currency',
help='Display foreign currency for move lines, unless ' help='Display foreign currency for move lines, unless '
'account currency is not setup through chart of accounts ' 'account currency is not setup through chart of accounts '
'will display initial and final balance in that currency.' 'will display initial and final balance in that currency.',
default=lambda self: self._default_foreign_currency(),
) )
def _default_foreign_currency(self):
return self.env.user.has_group('base.group_multi_currency')
def _default_partners(self):
context = self.env.context
if context.get('active_ids') and context.get('active_model') \
== 'res.partner':
partner_ids = context['active_ids']
corp_partners = self.env['res.partner'].browse(partner_ids). \
filtered(lambda p: p.parent_id)
partner_ids = set(partner_ids) - set(corp_partners.ids)
partner_ids |= set(corp_partners.mapped('parent_id.id'))
return list(partner_ids)
@api.onchange('company_id') @api.onchange('company_id')
def onchange_company_id(self): def onchange_company_id(self):
"""Handle company change.""" """Handle company change."""
@ -73,8 +91,10 @@ class OpenItemsReportWizard(models.TransientModel):
res['domain']['account_ids'] += [ res['domain']['account_ids'] += [
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
res['domain']['partner_ids'] += [ res['domain']['partner_ids'] += [
'&',
'|', ('company_id', '=', self.company_id.id), '|', ('company_id', '=', self.company_id.id),
('company_id', '=', False)] ('company_id', '=', False),
('parent_id', '=', False)]
return res return res
@api.onchange('receivable_accounts_only', 'payable_accounts_only') @api.onchange('receivable_accounts_only', 'payable_accounts_only')

View File

@ -58,4 +58,17 @@
view_id="open_items_wizard" view_id="open_items_wizard"
target="new" /> target="new" />
<!--Add to res.partner action-->
<act_window id="act_action_open_items_wizard_partner_relation"
name="Open Items Partner"
res_model="open.items.report.wizard"
src_model="res.partner"
view_mode="form"
context="{
'default_receivable_accounts_only':1,
'default_payable_accounts_only':1,
}"
key2="client_action_multi"
target="new" />
</odoo> </odoo>

View File

@ -138,8 +138,10 @@ class TrialBalanceReportWizard(models.TransientModel):
res['domain']['account_ids'] += [ res['domain']['account_ids'] += [
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
res['domain']['partner_ids'] += [ res['domain']['partner_ids'] += [
'&',
'|', ('company_id', '=', self.company_id.id), '|', ('company_id', '=', self.company_id.id),
('company_id', '=', False)] ('company_id', '=', False),
('parent_id', '=', False)]
res['domain']['date_range_id'] += [ res['domain']['date_range_id'] += [
'|', ('company_id', '=', self.company_id.id), '|', ('company_id', '=', self.company_id.id),
('company_id', '=', False)] ('company_id', '=', False)]