← Back to team overview

openerp-community-reviewer team mailing list archive

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

 

Guewen Baconnier @ Camptocamp has proposed merging lp:~camptocamp/account-financial-report/7.0-account_financial_report_webkit-journals-all into lp:account-financial-report.

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

Requested reviews:
  Account Report Core Editors (account-report-core-editor)

For more details, see:
https://code.launchpad.net/~camptocamp/account-financial-report/7.0-account_financial_report_webkit-journals-all/+merge/201352

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.
-- 
https://code.launchpad.net/~camptocamp/account-financial-report/7.0-account_financial_report_webkit-journals-all/+merge/201352
Your team Account Report Core Editors is requested to review the proposed merge of lp:~camptocamp/account-financial-report/7.0-account_financial_report_webkit-journals-all into lp:account-financial-report.
=== modified file 'account_financial_report_webkit/report_menus.xml'
--- account_financial_report_webkit/report_menus.xml	2013-09-12 20:53:27 +0000
+++ account_financial_report_webkit/report_menus.xml	2014-01-13 09:39:54 +0000
@@ -26,10 +26,13 @@
             parent="account.menu_journals_report" action="action_account_print_journal_menu_webkit"
             groups="account.group_account_manager,account.group_account_user" id="account.menu_account_print_journal"/>
 
-        <menuitem icon="STOCK_PRINT" name="Sale/Purchase Journals"
-            parent="account.menu_journals_report" action="action_account_print_journal_sale_purchase_menu_webkit"
-            groups="account.group_account_manager,account.group_account_user" id="account.menu_account_print_sale_purchase_journal"
-            sequence="1"/>
+        <!--
+        Hide Sale / Purchase Journals menu, replaced by a unique
+        "Journals" menu
+        -->
+        <record id="account.menu_account_print_sale_purchase_journal" model="ir.ui.menu">
+            <field name="groups">base.group_no_one</field>
+        </record>
 
     </data>
 </openerp>

=== modified file 'account_financial_report_webkit/wizard/print_journal.py'
--- account_financial_report_webkit/wizard/print_journal.py	2013-11-03 12:55:27 +0000
+++ account_financial_report_webkit/wizard/print_journal.py	2014-01-13 09:39:54 +0000
@@ -105,26 +105,6 @@
             res['value'] = {'period_from': start_period, 'period_to': end_period, 'date_from': False, 'date_to': False}
         return res
 
-    def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
-        '''
-        used to set the domain on 'journal_ids' field: we exclude or only propose the journals of type
-        sale/purchase (+refund) accordingly to the presence of the key 'sale_purchase_only' in the context.
-        '''
-        if context is None:
-            context = {}
-        res = super(AccountReportPrintJournalWizard, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
-        doc = etree.XML(res['arch'])
-
-        if context.get('sale_purchase_only'):
-            domain = "[('type', 'in', ('sale','purchase','sale_refund','purchase_refund'))]"
-        else:
-            domain = "[('type', 'not in', ('sale','purchase','sale_refund','purchase_refund'))]"
-        nodes = doc.xpath("//field[@name='journal_ids']")
-        for node in nodes:
-            node.set('domain', domain)
-        res['arch'] = etree.tostring(doc)
-        return res
-
     def _print_report(self, cursor, uid, ids, data, context=None):
         context = context or {}
         # we update form with display account value

=== modified file 'account_financial_report_webkit/wizard/print_journal_view.xml'
--- account_financial_report_webkit/wizard/print_journal_view.xml	2013-09-12 20:53:27 +0000
+++ account_financial_report_webkit/wizard/print_journal_view.xml	2014-01-13 09:39:54 +0000
@@ -86,16 +86,5 @@
             <field name="model">account.journal.period</field>
         </record>
 
-        <record id="action_account_print_journal_sale_purchase_menu_webkit" model="ir.actions.act_window">
-            <field name="name">Journals</field>
-            <field name="type">ir.actions.act_window</field>
-            <field name="res_model">print.journal.webkit</field>
-            <field name="view_type">form</field>
-            <field name="view_mode">form</field>
-            <field name="view_id" ref="account_report_print_journal_view_webkit"/>
-            <field name="context">{'sale_purchase_only':True}</field>
-            <field name="target">new</field>
-        </record>
-
     </data>
 </openerp>


Follow ups