From 50c1ae3819f919e2aec3cdbcced1f79bb94a7118 Mon Sep 17 00:00:00 2001 From: mreficent Date: Fri, 16 Jun 2017 12:32:20 +0200 Subject: [PATCH] [MIG] customer_activity_statement: Migration to 10.0 --- customer_activity_statement/README.rst | 2 +- .../{__openerp__.py => __manifest__.py} | 2 +- .../report/customer_activity_statement.py | 9 +- .../static/description/index.html | 2 +- .../tests/test_customer_activity_statement.py | 5 +- .../views/statement.xml | 2 +- .../customer_activity_statement_wizard.py | 2 +- .../customer_activity_statement_wizard.xml | 96 +++++++++---------- 8 files changed, 59 insertions(+), 61 deletions(-) rename customer_activity_statement/{__openerp__.py => __manifest__.py} (95%) diff --git a/customer_activity_statement/README.rst b/customer_activity_statement/README.rst index 23d318ef..821c6511 100644 --- a/customer_activity_statement/README.rst +++ b/customer_activity_statement/README.rst @@ -35,7 +35,7 @@ To use this module, you need to: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/91/9.0 + :target: https://runbot.odoo-community.org/runbot/91/10.0 Bug Tracker =========== diff --git a/customer_activity_statement/__openerp__.py b/customer_activity_statement/__manifest__.py similarity index 95% rename from customer_activity_statement/__openerp__.py rename to customer_activity_statement/__manifest__.py index 6e8479c2..493fac65 100644 --- a/customer_activity_statement/__openerp__.py +++ b/customer_activity_statement/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Customer Activity Statement', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Accounting & Finance', 'summary': 'OCA Financial Reports', 'author': "Eficent, Odoo Community Association (OCA)", diff --git a/customer_activity_statement/report/customer_activity_statement.py b/customer_activity_statement/report/customer_activity_statement.py index 9b2ec147..0bbcc577 100644 --- a/customer_activity_statement/report/customer_activity_statement.py +++ b/customer_activity_statement/report/customer_activity_statement.py @@ -4,8 +4,8 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from datetime import datetime, timedelta -from openerp.tools import DEFAULT_SERVER_DATE_FORMAT -from openerp import api, fields, models +from odoo.tools.misc import DEFAULT_SERVER_DATE_FORMAT +from odoo import api, fields, models class CustomerActivityStatement(models.AbstractModel): @@ -15,8 +15,7 @@ class CustomerActivityStatement(models.AbstractModel): def _format_date_to_partner_lang(self, str_date, partner_id): lang_code = self.env['res.partner'].browse(partner_id).lang - lang_id = self.env['res.lang']._lang_get(lang_code) - lang = self.env['res.lang'].browse(lang_id) + lang = self.env['res.lang']._lang_get(lang_code) date = datetime.strptime(str_date, DEFAULT_SERVER_DATE_FORMAT).date() return date.strftime(lang.date_format) @@ -272,7 +271,7 @@ class CustomerActivityStatement(models.AbstractModel): return res @api.multi - def render_html(self, data): + def render_html(self, docids, data): company_id = data['company_id'] partner_ids = data['partner_ids'] date_start = data['date_start'] diff --git a/customer_activity_statement/static/description/index.html b/customer_activity_statement/static/description/index.html index 9d218b04..4d35122d 100644 --- a/customer_activity_statement/static/description/index.html +++ b/customer_activity_statement/static/description/index.html @@ -8,7 +8,7 @@ -
+

The activity statement provides details of all activity on the customer receivables between two selected dates. This includes all invoices, refunds and payments. Any outstanding balance dated prior to diff --git a/customer_activity_statement/tests/test_customer_activity_statement.py b/customer_activity_statement/tests/test_customer_activity_statement.py index 700bbbdc..8d87d44b 100644 --- a/customer_activity_statement/tests/test_customer_activity_statement.py +++ b/customer_activity_statement/tests/test_customer_activity_statement.py @@ -3,7 +3,7 @@ # (http://www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from openerp.tests.common import TransactionCase +from odoo.tests.common import TransactionCase class TestCustomerActivityStatement(TransactionCase): @@ -60,7 +60,8 @@ class TestCustomerActivityStatement(TransactionCase): ) data = wiz_id._prepare_activity_statement() - report = self.statement_model.render_html(data) + docids = data['partner_ids'] + report = self.statement_model.render_html(docids, data) self.assertIsInstance(report, str, "There was an error while compiling the report.") self.assertIn("", report, diff --git a/customer_activity_statement/views/statement.xml b/customer_activity_statement/views/statement.xml index 1701cf4c..e03e0b7c 100644 --- a/customer_activity_statement/views/statement.xml +++ b/customer_activity_statement/views/statement.xml @@ -6,7 +6,7 @@

- +

diff --git a/customer_activity_statement/wizard/customer_activity_statement_wizard.py b/customer_activity_statement/wizard/customer_activity_statement_wizard.py index a2a48c98..e6e4f6d3 100644 --- a/customer_activity_statement/wizard/customer_activity_statement_wizard.py +++ b/customer_activity_statement/wizard/customer_activity_statement_wizard.py @@ -4,7 +4,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from datetime import date, timedelta -from openerp import api, fields, models +from odoo import api, fields, models class CustomerActivityStatementWizard(models.TransientModel): diff --git a/customer_activity_statement/wizard/customer_activity_statement_wizard.xml b/customer_activity_statement/wizard/customer_activity_statement_wizard.xml index 8e381221..20b5f145 100644 --- a/customer_activity_statement/wizard/customer_activity_statement_wizard.xml +++ b/customer_activity_statement/wizard/customer_activity_statement_wizard.xml @@ -1,51 +1,49 @@ - - - - + + + - - - Customer Activity Statement Wizard - customer.activity.statement.wizard - -
-
-

- - - - - - - - - - - - - - -
-
-
-
-
-
-
+ + + Customer Activity Statement Wizard + customer.activity.statement.wizard + +
+
+

+ + + + + + + + + + + + + + + +
+
+
+