From 6435d7f6922b77db30bb113c6a1886588cb2b170 Mon Sep 17 00:00:00 2001 From: Guillaume Auger Date: Tue, 27 Jan 2015 16:15:56 -0500 Subject: [PATCH 01/10] Port account_chart_report to V8: Moving files --- .../account_chart_report => account_chart_report}/__init__.py | 0 .../account_chart_report => account_chart_report}/__openerp__.py | 0 .../account_report.xml | 0 .../i18n/account_chart_report.pot | 0 .../account_chart_report => account_chart_report}/i18n/fr.po | 0 .../report/__init__.py | 0 .../report/chart_of_accounts.py | 0 .../report/chart_of_accounts.rml | 0 .../wizard/__init__.py | 0 .../wizard/account_report_chart_of_account.py | 0 .../wizard/account_report_chart_of_account.xml | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename {__unported__/account_chart_report => account_chart_report}/__init__.py (100%) rename {__unported__/account_chart_report => account_chart_report}/__openerp__.py (100%) rename {__unported__/account_chart_report => account_chart_report}/account_report.xml (100%) rename {__unported__/account_chart_report => account_chart_report}/i18n/account_chart_report.pot (100%) rename {__unported__/account_chart_report => account_chart_report}/i18n/fr.po (100%) rename {__unported__/account_chart_report => account_chart_report}/report/__init__.py (100%) rename {__unported__/account_chart_report => account_chart_report}/report/chart_of_accounts.py (100%) rename {__unported__/account_chart_report => account_chart_report}/report/chart_of_accounts.rml (100%) rename {__unported__/account_chart_report => account_chart_report}/wizard/__init__.py (100%) rename {__unported__/account_chart_report => account_chart_report}/wizard/account_report_chart_of_account.py (100%) rename {__unported__/account_chart_report => account_chart_report}/wizard/account_report_chart_of_account.xml (100%) diff --git a/__unported__/account_chart_report/__init__.py b/account_chart_report/__init__.py similarity index 100% rename from __unported__/account_chart_report/__init__.py rename to account_chart_report/__init__.py diff --git a/__unported__/account_chart_report/__openerp__.py b/account_chart_report/__openerp__.py similarity index 100% rename from __unported__/account_chart_report/__openerp__.py rename to account_chart_report/__openerp__.py diff --git a/__unported__/account_chart_report/account_report.xml b/account_chart_report/account_report.xml similarity index 100% rename from __unported__/account_chart_report/account_report.xml rename to account_chart_report/account_report.xml diff --git a/__unported__/account_chart_report/i18n/account_chart_report.pot b/account_chart_report/i18n/account_chart_report.pot similarity index 100% rename from __unported__/account_chart_report/i18n/account_chart_report.pot rename to account_chart_report/i18n/account_chart_report.pot diff --git a/__unported__/account_chart_report/i18n/fr.po b/account_chart_report/i18n/fr.po similarity index 100% rename from __unported__/account_chart_report/i18n/fr.po rename to account_chart_report/i18n/fr.po diff --git a/__unported__/account_chart_report/report/__init__.py b/account_chart_report/report/__init__.py similarity index 100% rename from __unported__/account_chart_report/report/__init__.py rename to account_chart_report/report/__init__.py diff --git a/__unported__/account_chart_report/report/chart_of_accounts.py b/account_chart_report/report/chart_of_accounts.py similarity index 100% rename from __unported__/account_chart_report/report/chart_of_accounts.py rename to account_chart_report/report/chart_of_accounts.py diff --git a/__unported__/account_chart_report/report/chart_of_accounts.rml b/account_chart_report/report/chart_of_accounts.rml similarity index 100% rename from __unported__/account_chart_report/report/chart_of_accounts.rml rename to account_chart_report/report/chart_of_accounts.rml diff --git a/__unported__/account_chart_report/wizard/__init__.py b/account_chart_report/wizard/__init__.py similarity index 100% rename from __unported__/account_chart_report/wizard/__init__.py rename to account_chart_report/wizard/__init__.py diff --git a/__unported__/account_chart_report/wizard/account_report_chart_of_account.py b/account_chart_report/wizard/account_report_chart_of_account.py similarity index 100% rename from __unported__/account_chart_report/wizard/account_report_chart_of_account.py rename to account_chart_report/wizard/account_report_chart_of_account.py diff --git a/__unported__/account_chart_report/wizard/account_report_chart_of_account.xml b/account_chart_report/wizard/account_report_chart_of_account.xml similarity index 100% rename from __unported__/account_chart_report/wizard/account_report_chart_of_account.xml rename to account_chart_report/wizard/account_report_chart_of_account.xml From ebaa30e3f4738939755c8a98892651f5ef74cdc9 Mon Sep 17 00:00:00 2001 From: Guillaume Auger Date: Tue, 27 Jan 2015 16:16:36 -0500 Subject: [PATCH 02/10] Port account_chart_report to V8: Changing api for V8 --- account_chart_report/__openerp__.py | 2 +- .../wizard/account_report_chart_of_account.py | 23 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/account_chart_report/__openerp__.py b/account_chart_report/__openerp__.py index 7d2fbde6..9569f452 100644 --- a/account_chart_report/__openerp__.py +++ b/account_chart_report/__openerp__.py @@ -48,6 +48,6 @@ Contributors 'account_report.xml', 'wizard/account_report_chart_of_account.xml', ], - 'installable': False, + 'installable': True, 'auto_install': False, } diff --git a/account_chart_report/wizard/account_report_chart_of_account.py b/account_chart_report/wizard/account_report_chart_of_account.py index b471bdbf..30254c78 100644 --- a/account_chart_report/wizard/account_report_chart_of_account.py +++ b/account_chart_report/wizard/account_report_chart_of_account.py @@ -20,24 +20,23 @@ # ############################################################################## -from openerp.osv import fields, orm +from openerp import fields, models, api -class ChartOfAccountsReport(orm.TransientModel): +class ChartOfAccountsReport(models.TransientModel): _name = 'account.print.chart.accounts.report' _description = 'Chart of accounts Report' domain_char_account = [('parent_id', '=', False)] - _columns = { - 'chart_account_id': fields.many2one('account.account', - 'Chart of Accounts', - help='Select Charts of Accounts', - required=True, - domain=domain_char_account), - } - - def print_report(self, cr, uid, ids, data, context=None): - res = self.read(cr, uid, ids, context=context)[0] + + chart_account_id = fields.Many2one('account.account', + 'Chart of Accounts', + help='Select Charts of Accounts', + required=True, + domain=domain_char_account) + @api.multi + def print_report(self, data): + res = self.read()[0] account_id = res["chart_account_id"][0] data["form"] = {"id_account": account_id} return { From acbe113e9ca33ff13c5fc1852820ee4f111dc532 Mon Sep 17 00:00:00 2001 From: Guillaume Auger Date: Wed, 28 Jan 2015 09:28:46 -0500 Subject: [PATCH 03/10] Port account_chart_report to V8: small refact --- .../wizard/account_report_chart_of_account.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/account_chart_report/wizard/account_report_chart_of_account.py b/account_chart_report/wizard/account_report_chart_of_account.py index 30254c78..7d16aef0 100644 --- a/account_chart_report/wizard/account_report_chart_of_account.py +++ b/account_chart_report/wizard/account_report_chart_of_account.py @@ -27,13 +27,12 @@ class ChartOfAccountsReport(models.TransientModel): _name = 'account.print.chart.accounts.report' _description = 'Chart of accounts Report' - domain_char_account = [('parent_id', '=', False)] - chart_account_id = fields.Many2one('account.account', 'Chart of Accounts', help='Select Charts of Accounts', required=True, - domain=domain_char_account) + domain=([('parent_id', '=', False)])) + @api.multi def print_report(self, data): res = self.read()[0] From 62423dc6e23c2d9a4b02b2c6981be9f5cd094b88 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 23 Jan 2015 10:00:21 +0100 Subject: [PATCH 04/10] [FIX] travis wkhtmltopdf download url --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index abde655a..705d9519 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ virtualenv: install: - git clone https://github.com/OCA/reporting-engine.git ${HOME}/reporting-engine -b ${VERSION} - git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools - - sudo wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-precise-amd64.deb -P /tmp/ + - sudo wget http://downloads.sourceforge.net/project/wkhtmltopdf/archive/0.12.1/wkhtmltox-0.12.1_linux-precise-amd64.deb -P /tmp/ - sudo dpkg -i /tmp/wkhtmltox-0.12.1_linux-precise-amd64.deb - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} - travis_install_nightly From d91d981b6ef634fb6cc102883264cef7db8852cc Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Thu, 29 Jan 2015 11:31:43 +0100 Subject: [PATCH 05/10] Fix 2 pep8 errors in account_financial_report_webkit --- account_financial_report_webkit/report/print_journal.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/account_financial_report_webkit/report/print_journal.py b/account_financial_report_webkit/report/print_journal.py index 1806f355..c693444e 100755 --- a/account_financial_report_webkit/report/print_journal.py +++ b/account_financial_report_webkit/report/print_journal.py @@ -126,7 +126,8 @@ class PrintJournalWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): objects = account_journal_period_obj.browse(self.cursor, self.uid, new_ids) # Sort by journal and period - objects.sorted(key=lambda a: (a.journal_id.code, a.period_id.date_start)) + objects.sorted(key=lambda a: (a.journal_id.code, + a.period_id.date_start)) move_obj = self.pool.get('account.move') moves = {} for journal_period in objects: @@ -139,7 +140,7 @@ class PrintJournalWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): move_ids = move_obj.search(self.cursor, self.uid, domain_arg, order="name") moves[journal_period.id] = move_obj.browse(self.cursor, self.uid, - move_ids) + move_ids) # Sort account move line by account accountant for move in moves[journal_period.id]: move.line_id.sorted(key=lambda a: (a.date, a.account_id.code)) From 83abecc923d8360a46c8a1597389f004084f200f Mon Sep 17 00:00:00 2001 From: Guillaume Auger Date: Fri, 30 Jan 2015 09:56:29 -0500 Subject: [PATCH 06/10] Refact and adding me to contributor --- account_chart_report/__openerp__.py | 1 + account_chart_report/wizard/account_report_chart_of_account.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/account_chart_report/__openerp__.py b/account_chart_report/__openerp__.py index 9569f452..a2496a19 100644 --- a/account_chart_report/__openerp__.py +++ b/account_chart_report/__openerp__.py @@ -36,6 +36,7 @@ Contributors ------------ * Marc Cassuto (marc.cassuto@savoirfairelinux.com) * Mathieu Benoit (mathieu.benoit@savoirfairelinux.com) +* Guillaume Auger (guillaume.auger@savoirfairelinux.com) """, 'author': 'Savoir-faire Linux', diff --git a/account_chart_report/wizard/account_report_chart_of_account.py b/account_chart_report/wizard/account_report_chart_of_account.py index 7d16aef0..8e29813c 100644 --- a/account_chart_report/wizard/account_report_chart_of_account.py +++ b/account_chart_report/wizard/account_report_chart_of_account.py @@ -35,8 +35,7 @@ class ChartOfAccountsReport(models.TransientModel): @api.multi def print_report(self, data): - res = self.read()[0] - account_id = res["chart_account_id"][0] + account_id = self.chart_account_id.id data["form"] = {"id_account": account_id} return { 'type': 'ir.actions.report.xml', From 8312cc196b6c311764aeadabb94d645e7b1490ce Mon Sep 17 00:00:00 2001 From: Guillaume Auger Date: Fri, 30 Jan 2015 17:07:58 -0500 Subject: [PATCH 07/10] Pep8 --- .../wizard/account_report_chart_of_account.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/account_chart_report/wizard/account_report_chart_of_account.py b/account_chart_report/wizard/account_report_chart_of_account.py index 8e29813c..4907b738 100644 --- a/account_chart_report/wizard/account_report_chart_of_account.py +++ b/account_chart_report/wizard/account_report_chart_of_account.py @@ -27,11 +27,12 @@ class ChartOfAccountsReport(models.TransientModel): _name = 'account.print.chart.accounts.report' _description = 'Chart of accounts Report' - chart_account_id = fields.Many2one('account.account', - 'Chart of Accounts', - help='Select Charts of Accounts', - required=True, - domain=([('parent_id', '=', False)])) + chart_account_id = fields.Many2one( + 'account.account', + 'Chart of Accounts', + help='Select Charts of Accounts', + required=True, + domain=([('parent_id', '=', False)])) @api.multi def print_report(self, data): From 4a430d1dd326c95010198b3058892a2bdc96afec Mon Sep 17 00:00:00 2001 From: Guillaume Auger Date: Mon, 2 Feb 2015 10:31:27 -0500 Subject: [PATCH 08/10] Pep8 --- .../wizard/account_report_chart_of_account.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/account_chart_report/wizard/account_report_chart_of_account.py b/account_chart_report/wizard/account_report_chart_of_account.py index 4907b738..872ac507 100644 --- a/account_chart_report/wizard/account_report_chart_of_account.py +++ b/account_chart_report/wizard/account_report_chart_of_account.py @@ -28,11 +28,11 @@ class ChartOfAccountsReport(models.TransientModel): _description = 'Chart of accounts Report' chart_account_id = fields.Many2one( - 'account.account', - 'Chart of Accounts', - help='Select Charts of Accounts', - required=True, - domain=([('parent_id', '=', False)])) + 'account.account', + 'Chart of Accounts', + help='Select Charts of Accounts', + required=True, + domain=([('parent_id', '=', False)])) @api.multi def print_report(self, data): From 16f5bf995f277207a9b22a93376e9106c88f5bd7 Mon Sep 17 00:00:00 2001 From: Guillaume Auger Date: Thu, 5 Feb 2015 10:45:03 -0500 Subject: [PATCH 09/10] [IMP] Adding README.rst in account_chart_report --- account_chart_report/README.rst | 14 ++++++++++++++ account_chart_report/__openerp__.py | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 account_chart_report/README.rst diff --git a/account_chart_report/README.rst b/account_chart_report/README.rst new file mode 100644 index 00000000..348c656f --- /dev/null +++ b/account_chart_report/README.rst @@ -0,0 +1,14 @@ +Print chart of accounts. + +This module add the menu Accounting \ Charts \ Print chart of Accounts +and allow to print the selected chart of accounts. + +This module is based on the old RML engine report. + +Contributors +------------ +* Marc Cassuto (marc.cassuto@savoirfairelinux.com) +* Mathieu Benoit (mathieu.benoit@savoirfairelinux.com) +* Guillaume Auger (guillaume.auger@savoirfairelinux.com) + + diff --git a/account_chart_report/__openerp__.py b/account_chart_report/__openerp__.py index a2496a19..654c4680 100644 --- a/account_chart_report/__openerp__.py +++ b/account_chart_report/__openerp__.py @@ -25,20 +25,6 @@ 'name': 'Print chart of accounts', 'version': '1.0', 'category': 'Reports/pdf', - 'description': """Print chart of accounts. - -This module add the menu Accounting \ Charts \ Print chart of Accounts -and allow to print the selected chart of accounts. - -This module is based on the old RML engine report. - -Contributors ------------- -* Marc Cassuto (marc.cassuto@savoirfairelinux.com) -* Mathieu Benoit (mathieu.benoit@savoirfairelinux.com) -* Guillaume Auger (guillaume.auger@savoirfairelinux.com) - - """, 'author': 'Savoir-faire Linux', 'website': 'http://www.savoirfairelinux.com', 'depends': [ From de0e1f1c0e043ee93161df42b7ec4d008c3a28bc Mon Sep 17 00:00:00 2001 From: Guillaume Auger Date: Fri, 6 Feb 2015 10:04:54 -0500 Subject: [PATCH 10/10] [IMP] Using the template for the README of account_chart_report --- account_chart_report/README.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/account_chart_report/README.rst b/account_chart_report/README.rst index 348c656f..ed6059e0 100644 --- a/account_chart_report/README.rst +++ b/account_chart_report/README.rst @@ -1,14 +1,17 @@ -Print chart of accounts. +Print chart of accounts +======================= This module add the menu Accounting \ Charts \ Print chart of Accounts and allow to print the selected chart of accounts. This module is based on the old RML engine report. +Credits +======= + Contributors ------------ + * Marc Cassuto (marc.cassuto@savoirfairelinux.com) * Mathieu Benoit (mathieu.benoit@savoirfairelinux.com) * Guillaume Auger (guillaume.auger@savoirfairelinux.com) - -