Merge lp:~camptocamp/account-financial-report/7.0-account_financial_report_webkit-journals-all into lp:~account-report-core-editor/account-financial-report/7.0

Proposed by Guewen Baconnier @ Camptocamp
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
Approved revision: 65
Merged at revision: 74
Proposed branch: lp:~camptocamp/account-financial-report/7.0-account_financial_report_webkit-journals-all
Merge into: lp:~account-report-core-editor/account-financial-report/7.0
Diff against target: 73 lines (+7/-35)
3 files modified
account_financial_report_webkit/report_menus.xml (+7/-4)
account_financial_report_webkit/wizard/print_journal.py (+0/-20)
account_financial_report_webkit/wizard/print_journal_view.xml (+0/-11)
To merge this branch: bzr merge lp:~camptocamp/account-financial-report/7.0-account_financial_report_webkit-journals-all
Reviewer Review Type Date Requested Status
Frederic Clementi - Camptocamp functional Approve
Leonardo Pistone code review Approve
Review via email: mp+201352@code.launchpad.net

Commit message

[CHG] allows to select all the journal types in the Journals report, remove the second menu (it was hidden because the action had the same name

Description of the change

Remove the artificial split between the "Sale/Purchase Journals" and the other journals.

In the 'account' module, there is 2 menus, one for "Sale/Purchase Journals" and one for the other Journals.
This split has been kept in the webkit report, but I propose to remove it. It was justified in the 'account' module because the output of the report was not the same for each menu. The report is always the same now, so we have no reasons to have 2 menus.

Moreover, the second menu (the one for Sales/Purchases) is hidden because the name of the action is the same than the other one (both were called "Journals"), so we have currently no way to print the sales/purchases journals.

To post a comment you must log in.
Revision history for this message
Leonardo Pistone (lepistone) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

necessary change
OK for me

review: Approve (functional)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_financial_report_webkit/report_menus.xml'
2--- account_financial_report_webkit/report_menus.xml 2013-09-12 20:53:27 +0000
3+++ account_financial_report_webkit/report_menus.xml 2014-01-13 09:39:54 +0000
4@@ -26,10 +26,13 @@
5 parent="account.menu_journals_report" action="action_account_print_journal_menu_webkit"
6 groups="account.group_account_manager,account.group_account_user" id="account.menu_account_print_journal"/>
7
8- <menuitem icon="STOCK_PRINT" name="Sale/Purchase Journals"
9- parent="account.menu_journals_report" action="action_account_print_journal_sale_purchase_menu_webkit"
10- groups="account.group_account_manager,account.group_account_user" id="account.menu_account_print_sale_purchase_journal"
11- sequence="1"/>
12+ <!--
13+ Hide Sale / Purchase Journals menu, replaced by a unique
14+ "Journals" menu
15+ -->
16+ <record id="account.menu_account_print_sale_purchase_journal" model="ir.ui.menu">
17+ <field name="groups">base.group_no_one</field>
18+ </record>
19
20 </data>
21 </openerp>
22
23=== modified file 'account_financial_report_webkit/wizard/print_journal.py'
24--- account_financial_report_webkit/wizard/print_journal.py 2013-11-03 12:55:27 +0000
25+++ account_financial_report_webkit/wizard/print_journal.py 2014-01-13 09:39:54 +0000
26@@ -105,26 +105,6 @@
27 res['value'] = {'period_from': start_period, 'period_to': end_period, 'date_from': False, 'date_to': False}
28 return res
29
30- def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
31- '''
32- used to set the domain on 'journal_ids' field: we exclude or only propose the journals of type
33- sale/purchase (+refund) accordingly to the presence of the key 'sale_purchase_only' in the context.
34- '''
35- if context is None:
36- context = {}
37- res = super(AccountReportPrintJournalWizard, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
38- doc = etree.XML(res['arch'])
39-
40- if context.get('sale_purchase_only'):
41- domain = "[('type', 'in', ('sale','purchase','sale_refund','purchase_refund'))]"
42- else:
43- domain = "[('type', 'not in', ('sale','purchase','sale_refund','purchase_refund'))]"
44- nodes = doc.xpath("//field[@name='journal_ids']")
45- for node in nodes:
46- node.set('domain', domain)
47- res['arch'] = etree.tostring(doc)
48- return res
49-
50 def _print_report(self, cursor, uid, ids, data, context=None):
51 context = context or {}
52 # we update form with display account value
53
54=== modified file 'account_financial_report_webkit/wizard/print_journal_view.xml'
55--- account_financial_report_webkit/wizard/print_journal_view.xml 2013-09-12 20:53:27 +0000
56+++ account_financial_report_webkit/wizard/print_journal_view.xml 2014-01-13 09:39:54 +0000
57@@ -86,16 +86,5 @@
58 <field name="model">account.journal.period</field>
59 </record>
60
61- <record id="action_account_print_journal_sale_purchase_menu_webkit" model="ir.actions.act_window">
62- <field name="name">Journals</field>
63- <field name="type">ir.actions.act_window</field>
64- <field name="res_model">print.journal.webkit</field>
65- <field name="view_type">form</field>
66- <field name="view_mode">form</field>
67- <field name="view_id" ref="account_report_print_journal_view_webkit"/>
68- <field name="context">{'sale_purchase_only':True}</field>
69- <field name="target">new</field>
70- </record>
71-
72 </data>
73 </openerp>

Subscribers

People subscribed via source and target branches

to status/vote changes: