← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-ara into lp:~openerp-dev/openobject-addons/trunk-dev-addons3

 

ARA(OpenERP) has proposed merging lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-ara into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.

Requested reviews:
  OpenERP R&D Team (openerp-dev)
Related bugs:
  #615522 Report Of Invoice  : Payment Term + Due date not printed
  https://bugs.launchpad.net/bugs/615522
  #649029 [sale] incoterm field poorly implemented [direct sql / not translatable]
  https://bugs.launchpad.net/bugs/649029
  #672553 opening entries from chart of account doesn't use context
  https://bugs.launchpad.net/bugs/672553
  #674480 [6.0 RC2] incorrect creation of Accounting Journals is some localizations prevents multiple charts from being installed
  https://bugs.launchpad.net/bugs/674480
  #681398 sale access right
  https://bugs.launchpad.net/bugs/681398
  #689536 [6.0] partner layout salesman/salesteam issue
  https://bugs.launchpad.net/bugs/689536
  #690326 [6.0RC1] View mode "tree,form,search" in several window actions
  https://bugs.launchpad.net/bugs/690326
  #690753 [6.0] and [5.x] account_analytic_line must not be deleted if the journal etc is deleted
  https://bugs.launchpad.net/bugs/690753
  #691072 [6.0RC1][TRUNK][account_voucher] Wrong definition of field 'company_id' in 'account_voucher_line' object
  https://bugs.launchpad.net/bugs/691072
  #692986 [6.0] hr_payroll_account hr_payroll_account_view.xml - required fields block opening form
  https://bugs.launchpad.net/bugs/692986

For more details, see:
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-dev-addons3-ara/+merge/44732

hello,

Account: removed field_view_get and replace field using xpath

Thanks
ara
-- 
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-dev-addons3-ara/+merge/44732
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-ara into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.
=== modified file 'account/wizard/account_report_account_balance.py'
--- account/wizard/account_report_account_balance.py	2010-10-04 09:52:23 +0000
+++ account/wizard/account_report_account_balance.py	2010-12-27 13:13:57 +0000
@@ -32,17 +32,6 @@
         'journal_ids': [],
     }
 
-    def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
-        mod_obj = self.pool.get('ir.model.data')
-        res = super(account_balance_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
-        doc = etree.XML(res['arch'])
-        nodes = doc.xpath("//field[@name='journal_ids']")
-        for node in nodes:
-            node.set('readonly', '1')
-            node.set('required', '0')
-        res['arch'] = etree.tostring(doc)
-        return res
-
     def _print_report(self, cr, uid, ids, data, context=None):
         data = self.pre_print_report(cr, uid, ids, data, context=context)
         return {'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data}

=== modified file 'account/wizard/account_report_account_balance_view.xml'
--- account/wizard/account_report_account_balance_view.xml	2010-11-16 13:37:57 +0000
+++ account/wizard/account_report_account_balance_view.xml	2010-12-27 13:13:57 +0000
@@ -10,6 +10,9 @@
           <field name="inherit_id" ref="account_common_report_view" />
           <field name="arch" type="xml">
             <data>
+            <xpath expr="//field[@name='journal_ids']" position="replace">
+                <field name="journal_ids" colspan="4" nolabel="1" readonly="1"/>
+            </xpath>
             <xpath expr="/form/label[@string='']" position="replace">
                 <separator string="Trial Balance" colspan="4"/>
                 <label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your trial balance allowing you to quickly check the balance of each of your accounts in a single report"/>

=== modified file 'account/wizard/account_report_aged_partner_balance.py'
--- account/wizard/account_report_aged_partner_balance.py	2010-11-10 08:20:11 +0000
+++ account/wizard/account_report_aged_partner_balance.py	2010-12-27 13:13:57 +0000
@@ -44,16 +44,6 @@
         'direction_selection': 'past',
     }
 
-    def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
-        res = super(account_aged_trial_balance, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
-        doc = etree.XML(res['arch'])
-        nodes = doc.xpath("//field[@name='journal_ids']")
-        for node in nodes:
-            node.set('invisible', '1')
-            node.set('required', '0')
-        res['arch'] = etree.tostring(doc)
-        return res
-
     def _print_report(self, cr, uid, ids, data, context=None):
         res = {}
         if context is None:

=== modified file 'account/wizard/account_report_aged_partner_balance_view.xml'
--- account/wizard/account_report_aged_partner_balance_view.xml	2010-11-12 11:54:13 +0000
+++ account/wizard/account_report_aged_partner_balance_view.xml	2010-12-27 13:13:57 +0000
@@ -20,7 +20,7 @@
                     <newline/>
                     <field name="result_selection"/>
                     <field name="direction_selection"/>
-                    <field name="journal_ids"/>
+                    <field name="journal_ids" invisible="1"/>
                     <newline/>
                     <separator colspan="4"/>
                     <group col="4" colspan="4">

=== modified file 'account/wizard/account_report_profit_loss.py'
--- account/wizard/account_report_profit_loss.py	2010-10-04 09:58:59 +0000
+++ account/wizard/account_report_profit_loss.py	2010-12-27 13:13:57 +0000
@@ -40,21 +40,6 @@
         'target_move': False
     }
 
-    def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
-        mod_obj = self.pool.get('ir.model.data')
-        res = super(account_pl_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
-        doc = etree.XML(res['arch'])
-        nodes = doc.xpath("//field[@name='journal_ids']")
-        for node in nodes:
-            node.set('readonly', '1')
-            node.set('required', '0')
-        nodes = doc.xpath("//field[@name='target_move']")
-        for node in nodes:
-            node.set('readonly', '1')
-            node.set('required', '0')
-        res['arch'] = etree.tostring(doc)
-        return res
-
     def _print_report(self, cr, uid, ids, data, context=None):
         if context is None:
             context = {}

=== modified file 'account/wizard/account_report_profit_loss_view.xml'
--- account/wizard/account_report_profit_loss_view.xml	2010-11-16 13:37:57 +0000
+++ account/wizard/account_report_profit_loss_view.xml	2010-12-27 13:13:57 +0000
@@ -9,6 +9,12 @@
             <field name="inherit_id" ref="account.account_common_report_view" />
             <field name="arch" type="xml">
             <data>
+            <xpath expr="//field[@name='target_move']" position="replace">
+                <field name="target_move" readonly="1"/>
+            </xpath>
+            <xpath expr="//field[@name='journal_ids']" position="replace">
+                <field name="journal_ids" colspan="4" nolabel="1" readonly="1"/>
+            </xpath>
             <xpath expr="/form/label[@string='']" position="replace">
                 <separator string="Profit And Loss" colspan="4"/>
                 <label nolabel="1" colspan="4" string="The Profit and Loss report gives you an overview of your company profit and loss in a single document"/>