Browse Source

[MIG] partner_statement: Migration to 14.0

pull/793/head
Víctor Martínez 3 years ago
parent
commit
b418c02c7f
  1. 13
      partner_statement/README.rst
  2. 5
      partner_statement/__manifest__.py
  3. 19
      partner_statement/i18n/de.po
  4. 18
      partner_statement/i18n/es.po
  5. 3
      partner_statement/i18n/es_AR.po
  6. 18
      partner_statement/i18n/fr.po
  7. 9
      partner_statement/i18n/it.po
  8. 9
      partner_statement/i18n/pt_BR.po
  9. 6
      partner_statement/i18n/ro.po
  10. 3
      partner_statement/readme/CONTRIBUTORS.rst
  11. 9
      partner_statement/report/activity_statement.py
  12. 9
      partner_statement/report/outstanding_statement.py
  13. 9
      partner_statement/report/report_statement_common.py
  14. 3
      partner_statement/security/ir.model.access.csv
  15. 12
      partner_statement/static/description/index.html
  16. 9
      partner_statement/tests/test_activity_statement.py
  17. 9
      partner_statement/tests/test_outstanding_statement.py
  18. 2
      partner_statement/tests/test_res_config_settings.py
  19. 15
      partner_statement/views/activity_statement.xml
  20. 15
      partner_statement/views/outstanding_statement.xml
  21. 11
      partner_statement/wizard/res_config_settings.py
  22. 14
      partner_statement/wizard/statement_common.py
  23. 73
      partner_statement/wizard/statement_wizard.xml

13
partner_statement/README.rst

@ -14,13 +14,13 @@ Partner Statement
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github
:target: https://github.com/OCA/account-financial-reporting/tree/13.0/partner_statement
:target: https://github.com/OCA/account-financial-reporting/tree/14.0/partner_statement
:alt: OCA/account-financial-reporting
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-financial-reporting-13-0/account-financial-reporting-13-0-partner_statement
:target: https://translation.odoo-community.org/projects/account-financial-reporting-14-0/account-financial-reporting-14-0-partner_statement
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/91/13.0
:target: https://runbot.odoo-community.org/runbot/91/14.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@ -96,7 +96,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-reporting/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20partner_statement%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20partner_statement%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@ -114,6 +114,9 @@ Contributors
* Miquel Raïch <miquel.raich@forgeflow.com>
* Graeme Gellatly <graeme@o4sb.com>
* Lois Rilo <lois.rilo@forgeflow.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Víctor Martínez
Maintainers
~~~~~~~~~~~
@ -128,6 +131,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/account-financial-reporting <https://github.com/OCA/account-financial-reporting/tree/13.0/partner_statement>`_ project on GitHub.
This module is part of the `OCA/account-financial-reporting <https://github.com/OCA/account-financial-reporting/tree/14.0/partner_statement>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

5
partner_statement/__manifest__.py

@ -3,16 +3,17 @@
{
"name": "Partner Statement",
"version": "13.0.1.2.0",
"version": "14.0.1.0.0",
"category": "Accounting & Finance",
"summary": "OCA Financial Reports",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"author": "ForgeFlow, Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-financial-reporting",
"license": "AGPL-3",
"depends": ["account"],
"external_dependencies": {"python": ["dateutil"]},
"data": [
"security/statement_security.xml",
"security/ir.model.access.csv",
"views/activity_statement.xml",
"views/outstanding_statement.xml",
"views/assets.xml",

19
partner_statement/i18n/de.po

@ -528,22 +528,3 @@ msgstr "in"
#: model_terms:ir.ui.view,arch_db:partner_statement.statement_common_view
msgid "or"
msgstr "oder"
#, fuzzy
#~| msgid "report.customer_activity_statement.statement"
#~ msgid "report.partner_statement.activity_statement"
#~ msgstr "report.customer_activity_statement.statement"
#, fuzzy
#~| msgid "report.customer_activity_statement.statement"
#~ msgid "report.partner_statement.outstanding_statement"
#~ msgstr "report.customer_activity_statement.statement"
#~ msgid "Balance Due"
#~ msgstr "Fälliger Saldo"
#~ msgid "Date:"
#~ msgstr "Datum:"
#~ msgid "Partner ref:"
#~ msgstr "Partner-Ref.:"

18
partner_statement/i18n/es.po

@ -512,21 +512,3 @@ msgstr "en"
#: model_terms:ir.ui.view,arch_db:partner_statement.statement_common_view
msgid "or"
msgstr "o"
#~ msgid "Payment"
#~ msgstr "Pago"
#~ msgid "report.partner_statement.activity_statement"
#~ msgstr "report.partner_statement.activity_statement"
#~ msgid "report.partner_statement.outstanding_statement"
#~ msgstr "report.partner_statement.outstanding_statement"
#~ msgid "Balance Due"
#~ msgstr "Saldo"
#~ msgid "Date:"
#~ msgstr "Fecha:"
#~ msgid "Partner ref:"
#~ msgstr "Ref. de Cliente:"

3
partner_statement/i18n/es_AR.po

@ -507,6 +507,3 @@ msgstr "en"
#: model_terms:ir.ui.view,arch_db:partner_statement.statement_common_view
msgid "or"
msgstr "o"
#~ msgid "Payment"
#~ msgstr "Pago"

18
partner_statement/i18n/fr.po

@ -508,21 +508,3 @@ msgstr "en"
#: model_terms:ir.ui.view,arch_db:partner_statement.statement_common_view
msgid "or"
msgstr "ou"
#~ msgid "Payment"
#~ msgstr "Paiement"
#~ msgid "report.partner_statement.activity_statement"
#~ msgstr "report.customer_activity_statement.statement"
#~ msgid "report.partner_statement.outstanding_statement"
#~ msgstr "report.customer_activity_statement.statement"
#~ msgid "Balance Due"
#~ msgstr "Solde dû"
#~ msgid "Date:"
#~ msgstr "Date :"
#~ msgid "Partner ref:"
#~ msgstr "Réf. partenaire :"

9
partner_statement/i18n/it.po

@ -496,12 +496,3 @@ msgstr "in"
#: model_terms:ir.ui.view,arch_db:partner_statement.statement_common_view
msgid "or"
msgstr "o"
#~ msgid "Payment"
#~ msgstr "Pagamento"
#~ msgid "report.partner_statement.activity_statement"
#~ msgstr "report.partner_statement.activity_statement"
#~ msgid "report.partner_statement.outstanding_statement"
#~ msgstr "report.partner_statement.outstanding_statement"

9
partner_statement/i18n/pt_BR.po

@ -505,12 +505,3 @@ msgstr "em"
#: model_terms:ir.ui.view,arch_db:partner_statement.statement_common_view
msgid "or"
msgstr "ou"
#~ msgid "Payment"
#~ msgstr "Pagamento"
#~ msgid "report.partner_statement.activity_statement"
#~ msgstr "report.partner_statement.activity_statement"
#~ msgid "report.partner_statement.outstanding_statement"
#~ msgstr "report.partner_statement.outstanding_statement"

6
partner_statement/i18n/ro.po

@ -507,9 +507,3 @@ msgstr "în"
#: model_terms:ir.ui.view,arch_db:partner_statement.statement_common_view
msgid "or"
msgstr "sau"
#~ msgid "Payment"
#~ msgstr "Plată"
#~ msgid "Date:"
#~ msgstr "Data:"

3
partner_statement/readme/CONTRIBUTORS.rst

@ -1,3 +1,6 @@
* Miquel Raïch <miquel.raich@forgeflow.com>
* Graeme Gellatly <graeme@o4sb.com>
* Lois Rilo <lois.rilo@forgeflow.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Víctor Martínez

9
partner_statement/report/activity_statement.py

@ -14,6 +14,7 @@ class ActivityStatement(models.AbstractModel):
_description = "Partner Activity Statement"
def _initial_balance_sql_q1(self, partners, date_start, account_type):
# flake8: noqa
return str(
self._cr.mogrify(
"""
@ -28,8 +29,10 @@ class ActivityStatement(models.AbstractModel):
END as credit
FROM account_move_line l
JOIN account_move m ON (l.move_id = m.id)
JOIN account_account l_account ON l.account_id = l_account.id
JOIN account_account_type l_account_type ON l_account.user_type_id = l_account_type.id
WHERE l.partner_id IN %(partners)s
AND l.account_internal_type = %(account_type)s
AND l_account_type.type = %(account_type)s
AND l.date < %(date_start)s AND not l.blocked
AND m.state IN ('posted')
GROUP BY l.partner_id, l.currency_id, l.amount_currency,
@ -107,9 +110,11 @@ class ActivityStatement(models.AbstractModel):
END as date_maturity
FROM account_move_line l
JOIN account_move m ON (l.move_id = m.id)
JOIN account_account l_account ON l.account_id = l_account.id
JOIN account_account_type l_account_type ON l_account.user_type_id = l_account_type.id
JOIN account_journal aj ON (l.journal_id = aj.id)
WHERE l.partner_id IN %(partners)s
AND l.account_internal_type = %(account_type)s
AND l_account_type.type = %(account_type)s
AND %(date_start)s <= l.date
AND l.date <= %(date_end)s
AND m.state IN ('posted')

9
partner_statement/report/outstanding_statement.py

@ -13,6 +13,7 @@ class OutstandingStatement(models.AbstractModel):
def _display_lines_sql_q1(self, partners, date_end, account_type):
partners = tuple(partners)
# flake8: noqa
return str(
self._cr.mogrify(
"""
@ -35,8 +36,8 @@ class OutstandingStatement(models.AbstractModel):
ELSE l.balance + sum(coalesce(pc.amount, 0.0))
END AS open_amount,
CASE WHEN l.balance > 0.0
THEN l.amount_currency - sum(coalesce(pd.amount_currency, 0.0))
ELSE l.amount_currency + sum(coalesce(pc.amount_currency, 0.0))
THEN l.amount_currency - sum(coalesce(pd.debit_amount_currency, 0.0))
ELSE l.amount_currency + sum(coalesce(pc.debit_amount_currency, 0.0))
END AS open_amount_currency,
CASE WHEN l.date_maturity is null
THEN l.date
@ -44,6 +45,8 @@ class OutstandingStatement(models.AbstractModel):
END as date_maturity
FROM account_move_line l
JOIN account_move m ON (l.move_id = m.id)
JOIN account_account l_account ON l.account_id = l_account.id
JOIN account_account_type l_account_type ON l_account.user_type_id = l_account_type.id
LEFT JOIN (SELECT pr.*
FROM account_partial_reconcile pr
INNER JOIN account_move_line l2
@ -57,7 +60,7 @@ class OutstandingStatement(models.AbstractModel):
WHERE l2.date <= %(date_end)s
) as pc ON pc.credit_move_id = l.id
WHERE l.partner_id IN %(partners)s
AND l.account_internal_type = %(account_type)s
AND l_account_type.type = %(account_type)s
AND (
(pd.id IS NOT NULL AND
pd.max_date <= %(date_end)s) OR

9
partner_statement/report/report_statement_common.py

@ -35,6 +35,7 @@ class ReportStatementCommon(models.AbstractModel):
return {}
def _show_buckets_sql_q1(self, partners, date_end, account_type):
# flake8: noqa
return str(
self._cr.mogrify(
"""
@ -44,8 +45,8 @@ class ReportStatementCommon(models.AbstractModel):
ELSE l.balance + sum(coalesce(pc.amount, 0.0))
END AS open_due,
CASE WHEN l.balance > 0.0
THEN l.amount_currency - sum(coalesce(pd.amount_currency, 0.0))
ELSE l.amount_currency + sum(coalesce(pc.amount_currency, 0.0))
THEN l.amount_currency - sum(coalesce(pd.debit_amount_currency, 0.0))
ELSE l.amount_currency + sum(coalesce(pc.debit_amount_currency, 0.0))
END AS open_due_currency,
CASE WHEN l.date_maturity is null
THEN l.date
@ -53,6 +54,8 @@ class ReportStatementCommon(models.AbstractModel):
END as date_maturity
FROM account_move_line l
JOIN account_move m ON (l.move_id = m.id)
JOIN account_account l_account ON l.account_id = l_account.id
JOIN account_account_type l_account_type ON l_account.user_type_id = l_account_type.id
LEFT JOIN (SELECT pr.*
FROM account_partial_reconcile pr
INNER JOIN account_move_line l2
@ -66,7 +69,7 @@ class ReportStatementCommon(models.AbstractModel):
WHERE l2.date <= %(date_end)s
) as pc ON pc.credit_move_id = l.id
WHERE l.partner_id IN %(partners)s
AND l.account_internal_type = %(account_type)s
AND l_account_type.type = %(account_type)s
AND (
(pd.id IS NOT NULL AND
pd.max_date <= %(date_end)s) OR

3
partner_statement/security/ir.model.access.csv

@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_activity_statement_wizard,activity.statement.wizard,model_activity_statement_wizard,base.group_user,1,1,1,0
access_outstanding_statement_wizard,outstanding.statement.wizard,model_outstanding_statement_wizard,base.group_user,1,1,1,0

12
partner_statement/static/description/index.html

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Partner Statement</title>
<style type="text/css">
@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/account-financial-reporting/tree/13.0/partner_statement"><img alt="OCA/account-financial-reporting" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/account-financial-reporting-13-0/account-financial-reporting-13-0-partner_statement"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/91/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/account-financial-reporting/tree/14.0/partner_statement"><img alt="OCA/account-financial-reporting" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/account-financial-reporting-14-0/account-financial-reporting-14-0-partner_statement"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/91/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of Invoicing to support the printing of customer and vendor statements.
There are two types of statements, Activity and Outstanding. Aging details can be shown in the reports, expressed in aging buckets,
so the customer or vendor can review how much is open, due or overdue.</p>
@ -449,7 +449,7 @@ outstanding payments. The list is displayed in chronological order and is split
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-financial-reporting/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20partner_statement%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20partner_statement%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@ -466,6 +466,10 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Miquel Raïch &lt;<a class="reference external" href="mailto:miquel.raich&#64;forgeflow.com">miquel.raich&#64;forgeflow.com</a>&gt;</li>
<li>Graeme Gellatly &lt;<a class="reference external" href="mailto:graeme&#64;o4sb.com">graeme&#64;o4sb.com</a>&gt;</li>
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Víctor Martínez</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
@ -475,7 +479,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-reporting/tree/13.0/partner_statement">OCA/account-financial-reporting</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-reporting/tree/14.0/partner_statement">OCA/account-financial-reporting</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

9
partner_statement/tests/test_activity_statement.py

@ -55,14 +55,13 @@ class TestActivityStatement(TransactionCase):
statement = wiz_id.button_export_pdf()
self.assertDictContainsSubset(
self.assertGreaterEqual(
statement.items(),
{
"type": "ir.actions.report",
"report_name": self.report_name,
"report_type": "qweb-pdf",
},
statement,
"There was an error and the PDF report was not generated.",
"report_name": self.report_name,
}.items(),
)
data = wiz_id._prepare_statement()

9
partner_statement/tests/test_outstanding_statement.py

@ -51,14 +51,13 @@ class TestOutstandingStatement(TransactionCase):
statement = wiz_id.button_export_pdf()
self.assertDictContainsSubset(
self.assertGreaterEqual(
statement.items(),
{
"type": "ir.actions.report",
"report_name": self.report_name,
"report_type": "qweb-pdf",
},
statement,
"There was an error and the PDF report was not generated.",
"report_name": self.report_name,
}.items(),
)
data = wiz_id._prepare_statement()

2
partner_statement/tests/test_res_config_settings.py

@ -32,4 +32,4 @@ class TestResConfigSettings(TransactionCase):
self.user_obj._has_group("partner_statement.group_activity_statement")
)
res = self.env["ir.default"].get("activity.statement.wizard", "aging_type")
self.assertEquals(res, "months")
self.assertEqual(res, "months")

15
partner_statement/views/activity_statement.xml

@ -161,13 +161,10 @@
</t>
</t>
</template>
<report
id="action_print_activity_statement"
model="res.partner"
report_type="qweb-pdf"
menu="False"
string="Activity Statement"
name="partner_statement.activity_statement"
file="partner_statement.activity_statement"
/>
<record id="action_print_activity_statement" model="ir.actions.report">
<field name="name">Activity Statement</field>
<field name="model">res.partner</field>
<field name="report_name">partner_statement.activity_statement</field>
<field name="report_file">partner_statement.activity_statement</field>
</record>
</odoo>

15
partner_statement/views/outstanding_statement.xml

@ -157,13 +157,10 @@
</t>
</t>
</template>
<report
id="action_print_outstanding_statement"
model="res.partner"
report_type="qweb-pdf"
menu="False"
string="Outstanding Statement"
name="partner_statement.outstanding_statement"
file="partner_statement.outstanding_statement"
/>
<record id="action_print_outstanding_statement" model="ir.actions.report">
<field name="name">Outstanding Statement</field>
<field name="model">res.partner</field>
<field name="report_name">partner_statement.outstanding_statement</field>
<field name="report_file">partner_statement.outstanding_statement</field>
</record>
</odoo>

11
partner_statement/wizard/res_config_settings.py

@ -5,11 +5,10 @@ class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
group_activity_statement = fields.Boolean(
"Enable OCA Activity Statements",
string="Enable OCA Activity Statements",
group="account.group_account_invoice",
implied_group="partner_statement.group_activity_statement",
)
default_aging_type = fields.Selection(
[("days", "Age by Days"), ("months", "Age by Months")],
string="Aging Method",
@ -17,22 +16,18 @@ class ResConfigSettings(models.TransientModel):
default="days",
default_model="statement.common.wizard",
)
default_show_aging_buckets = fields.Boolean(
string="Show Aging Buckets", default_model="statement.common.wizard"
)
default_filter_partners_non_due = fields.Boolean(
string="Exclude partners with no due entries",
default_model="statement.common.wizard",
)
default_filter_negative_balances = fields.Boolean(
"Exclude Negative Balances", default_model="statement.common.wizard"
string="Exclude Negative Balances", default_model="statement.common.wizard"
)
group_outstanding_statement = fields.Boolean(
"Enable OCA Outstanding Statements",
string="Enable OCA Outstanding Statements",
group="account.group_account_invoice",
implied_group="partner_statement.group_outstanding_statement",
)

14
partner_statement/wizard/statement_common.py

@ -7,20 +7,13 @@ from odoo import api, fields, models
class StatementCommon(models.AbstractModel):
_name = "statement.common.wizard"
_description = "Statement Reports Common Wizard"
def _get_company(self):
return (
self.env["res.company"].browse(self.env.context.get("force_company"))
or self.env.company
)
name = fields.Char()
company_id = fields.Many2one(
comodel_name="res.company",
default=_get_company,
default=lambda self: self.env.company,
string="Company",
required=True,
)
@ -32,8 +25,9 @@ class StatementCommon(models.AbstractModel):
filter_partners_non_due = fields.Boolean(
string="Don't show partners with no due entries", default=True
)
filter_negative_balances = fields.Boolean("Exclude Negative Balances", default=True)
filter_negative_balances = fields.Boolean(
string="Exclude Negative Balances", default=True
)
aging_type = fields.Selection(
[("days", "Age by Days"), ("months", "Age by Months")],
string="Aging Method",

73
partner_statement/wizard/statement_wizard.xml

@ -3,24 +3,28 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<!-- wizard action on res.partner -->
<act_window
id="activity_statement_wizard_action"
name="Partner Activity Statement"
binding_model="res.partner"
res_model="activity.statement.wizard"
view_mode="form"
target="new"
groups="partner_statement.group_activity_statement"
/>
<act_window
id="outstanding_statement_wizard_action"
name="Partner Outstanding Statement"
binding_model="res.partner"
res_model="outstanding.statement.wizard"
view_mode="form"
target="new"
groups="partner_statement.group_outstanding_statement"
/>
<record id="activity_statement_wizard_action" model="ir.actions.act_window">
<field name="name">Partner Activity Statement</field>
<field name="binding_model_id" ref="base.model_res_partner" />
<field name="res_model">activity.statement.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field
name="groups_id"
eval="[(4, ref('partner_statement.group_activity_statement'))]"
/>
</record>
<record id="outstanding_statement_wizard_action" model="ir.actions.act_window">
<field name="name">Partner Outstanding Statement</field>
<field name="binding_model_id" ref="base.model_res_partner" />
<field name="res_model">activity.statement.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field
name="groups_id"
eval="[(4, ref('partner_statement.group_activity_statement'))]"
/>
</record>
<!-- wizard view -->
<record id="statement_common_view" model="ir.ui.view">
<field name="name">Statement Common Wizard View</field>
@ -28,11 +32,10 @@
<field name="arch" type="xml">
<form name="Report Options">
<div style="text-align:justify" name="info">
<label
string="Aging details can be shown in the report, expressed in aging
buckets, so the partner can review how much is open, due or overdue."
for=""
/>
<span
class="o_form_label"
>Aging details can be shown in the report, expressed in aging
buckets, so the partner can review how much is open, due or overdue.</span>
</div>
<hr />
<group>
@ -42,7 +45,7 @@
options="{'no_create': True}"
groups="base.group_multi_company"
/>
<label for="account_type" />
<span class="o_form_label">Account type</span>
<field name="account_type" nolabel="1" widget="radio" />
</group>
<group name="aging_report">
@ -86,14 +89,13 @@
<field name="inherit_id" ref="partner_statement.statement_common_view" />
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//div[@name='info']/label" position="before">
<label
string="The outstanding statement provides details of all partner's outstanding
<xpath expr="//div[@name='info']/span" position="before">
<span
class="o_form_label"
>The outstanding statement provides details of all partner's outstanding
receivables and payables up to a particular date. This includes all unpaid invoices, unclaimed
refunds and outstanding payments. The list is displayed in chronological order and is
split by currencies."
for=""
/>
split by currencies.</span>
<br />
<br />
</xpath>
@ -105,15 +107,14 @@
<field name="inherit_id" ref="partner_statement.statement_common_view" />
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//div[@name='info']/label" position="before">
<label
string="The activity statement provides details of all activity on
<xpath expr="//div[@name='info']/span" position="before">
<span
class="o_form_label"
>The activity statement provides details of all activity on
a partner's receivables and payables between two selected dates. This includes all invoices,
refunds and payments. Any outstanding balance dated prior to the chosen statement
period will appear as a forward balance at the top of the statement. The list is
displayed in chronological order and is split by currencies."
for=""
/>
displayed in chronological order and is split by currencies.</span>
<br />
<br />
</xpath>

Loading…
Cancel
Save