Pedro Manuel Baeza has proposed merging 
lp:~pedro.baeza/banking-addons/bank-statement-reconcile-70-import_imp into 
lp:banking-addons/bank-statement-reconcile-7.0.

Requested reviews:
  Banking Addons Core Editors (banking-addons-team)

For more details, see:
https://code.launchpad.net/~pedro.baeza/banking-addons/bank-statement-reconcile-70-import_imp/+merge/200022

Improved system to inherit selection of the different import types, because as 
it was, you have to redefine the field on each extension module, due to OpenERP 
doesn't allow direct inheritance on selection methods.

Now, the selection method calls another private method that can be inherited 
without problems.
-- 
https://code.launchpad.net/~pedro.baeza/banking-addons/bank-statement-reconcile-70-import_imp/+merge/200022
Your team Banking Addons Core Editors is requested to review the proposed merge 
of lp:~pedro.baeza/banking-addons/bank-statement-reconcile-70-import_imp into 
lp:banking-addons/bank-statement-reconcile-7.0.
=== modified file 'account_statement_base_import/statement.py'
--- account_statement_base_import/statement.py	2013-09-12 09:05:01 +0000
+++ account_statement_base_import/statement.py	2013-12-24 18:21:26 +0000
@@ -31,11 +31,12 @@
 class AccountStatementProfil(Model):
     _inherit = "account.statement.profile"
 
+    def _get_import_type_selection(self, cr, uid, context=None):
+        """This is the method to be inherited for adding the parser"""
+        return [('generic_csvxls_so', 'Generic .csv/.xls based on SO Name')]
+
     def get_import_type_selection(self, cr, uid, context=None):
-        """
-        Has to be inherited to add parser
-        """
-        return [('generic_csvxls_so', 'Generic .csv/.xls based on SO Name')]
+        return _get_import_type selection(cr, uid, context=context)
 
     _columns = {
         'launch_import_completion': fields.boolean(

=== modified file 'account_statement_ofx_import/statement.py'
--- account_statement_ofx_import/statement.py	2013-11-04 12:22:39 +0000
+++ account_statement_ofx_import/statement.py	2013-12-24 18:21:26 +0000
@@ -24,7 +24,7 @@
 class AccountStatementProfil(orm.Model):
     _inherit = "account.statement.profile"
 
-    def get_import_type_selection(self, cr, uid, context=None):
+    def _get_import_type_selection(self, cr, uid, context=None):
         """
         Inherited from parent to add parser.
         """
@@ -33,14 +33,3 @@
                                                       context=context)
         selection.append(('ofx_so', _('OFX - Open Financial Exchange')))
         return selection
-
-    _columns = {
-        'import_type': fields.selection(
-            get_import_type_selection,
-            'Type of import',
-            required=True,
-            help="Choose here the method by which you want to import bank"
-                 "statement for this profile."),
-
-    }
-

-- 
Mailing list: https://launchpad.net/~banking-addons-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~banking-addons-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to