-
-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[9.0][ADD] Account Journal Report #298
[9.0][ADD] Account Journal Report #298
Conversation
5eb1b8e
to
cbe72ab
Compare
b4a1c74
to
ca862cc
Compare
account_journal_report/README.rst
Outdated
|
||
#. Go to *Invoicing* or *Accounting* menu | ||
#. Press 'Reporting > PDF Reports > Journal Ledger' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include a line for indicating that pressing button "Export", you'll get the report on Excel.
account_journal_report/README.rst
Outdated
Contributors | ||
------------ | ||
|
||
* Jordi Esteve <jesteve@zikzakmedia.com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this one, as the code has nothing to do with this original contributor now.
account_journal_report/__init__.py
Outdated
@@ -0,0 +1,14 @@ | |||
# -*- coding: utf-8 -*- | |||
# Copyright 2009 Zikzakmedia S.L. (http://zikzakmedia.com) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file doesn't need this overloaded header.
@@ -0,0 +1,32 @@ | |||
# -*- coding: utf-8 -*- | |||
# Copyright 2009 Zikzakmedia S.L. - Jordi Esteve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this copyright.
"report_xlsx", | ||
], | ||
'license': "AGPL-3", | ||
'author': "Zikzakmedia SL, " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the first author as stated.
[('date', '<=', date_end), | ||
('date', '>=', date_start), | ||
('journal_id', 'in', journal_ids), | ||
('state', '<>', 'draft')], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/<>/!= (the other operator is deprecated)
self.company = self.env.ref('base.main_company') | ||
self.g_account_user = self.env.ref('account.group_account_user') | ||
|
||
self.user = self._create_user('user_1', [self.g_account_user], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For assuring the test, you must provide account data. Please check my tests for v8: https://github.com/OCA/l10n-spain/blob/8.0/l10n_es_account_financial_report/tests/test_journal_entries_report.py, that adds all the needed records.
from openerp.tests.common import TransactionCase | ||
|
||
|
||
class TestAccountJournalReport(TransactionCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use SavepointCase instead, that is more efficient. You need to switch setUp method, but only that. You can see an example here: https://github.com/OCA/l10n-spain/blob/8.0/l10n_es_account_financial_report/tests/test_journal_entries_report.py
self.report_xlsx_name = 'account_journal_report.journal_ledger_xlsx' | ||
self.report_title = 'Journal Ledger' | ||
|
||
def _create_user(self, login, groups, company): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to create a new user for this, as tests are run as admin, and I see no use of this user for testing any permission.
|
||
def test_account_journal_report(self): | ||
|
||
wiz_id = self.wiz.create({}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Control in your wizard creation data for your test, including the journal and dates you want to print. Check https://github.com/OCA/l10n-spain/blob/8.0/l10n_es_account_financial_report/tests/test_journal_entries_report.py for my test in v8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not necessary because the journal and dates are established by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's a safeguard, because you have to make your tests state-consistent, and if you depend on the default values of the wizard, maybe any change can make this fail (for example, a custom module that changes these defaults in a customer).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, the data is added.
Please include also full Spanish translation |
</record> | ||
|
||
<!-- Add XLSX export button --> | ||
<record id="account_journal_ledger_xlsx_view" model="ir.ui.view"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The export button should be added in the main view, there is no need to creat an extension view for it.
f4d32f6
to
ad6de20
Compare
@pedrobaeza About the translations, why should I put them? The Transifex solves this, right? |
No if you don't translate them on Transifex, and this makes at least one week difference. For initial translation upload, you should provide it with the module. |
2518338
to
df3e53e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are texts that are not translated yet. Can you please do it?
super(TestAccountJournalReport, self).setUp() | ||
|
||
self.company = self.env.ref('base.main_company') | ||
self.g_account_user = self.env.ref('account.group_account_user') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a note, this is not needed, but it doesn't make the module fail.
414a452
to
2093479
Compare
All done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Journal Report
Adds the following report in PDF and XLSX format:
cc: @pedrobaeza @gboros-rgbconsulting @jbeficent