← Back to team overview

savoirfairelinux-openerp team mailing list archive

lp:~savoirfairelinux-openerp/openobject-extension/7.0-moved-modules-to-server-env-tools into lp:openobject-extension

 

Maxime Chambreuil (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/openobject-extension/7.0-moved-modules-to-server-env-tools into lp:openobject-extension.

Requested reviews:
  extra-addons-commiter (extra-addons-commiter)

For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openobject-extension/7.0-moved-modules-to-server-env-tools/+merge/183541

[REM] import_odbc and base_external_dbsource moved to lp:server-env-tools/7.0
-- 
https://code.launchpad.net/~savoirfairelinux-openerp/openobject-extension/7.0-moved-modules-to-server-env-tools/+merge/183541
Your team Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/openobject-extension/7.0-moved-modules-to-server-env-tools.
=== modified file 'base_external_cron/__openerp__.py'
--- base_external_cron/__openerp__.py	2012-12-26 09:58:46 +0000
+++ base_external_cron/__openerp__.py	2013-09-02 20:41:47 +0000
@@ -23,7 +23,7 @@
 
 {
     'name': 'base_external_cron',
-    'version': '6.1.0',
+    'version': '0.1',
     'category': 'Generic Modules/Others',
     'license': 'AGPL-3',
     'description': """empty""",
@@ -35,7 +35,7 @@
            'external_cron_view.xml',
     ],
     'demo_xml': [],
-    'installable': False,
+    'installable': True,
     'active': False,
 }
 

=== modified file 'base_external_cron/external_cron.py'
--- base_external_cron/external_cron.py	2012-12-03 16:26:23 +0000
+++ base_external_cron/external_cron.py	2013-09-02 20:41:47 +0000
@@ -19,100 +19,31 @@
 #                                                                             #
 ###############################################################################
 
-from openerp.osv.orm import Model, except_orm
+from openerp.osv.orm import Model
 from openerp.osv import fields
-from tools.translate import _
-
-#TODO refactor the constraint on ext_cron, this should be not harcoded
-EXT_CRON_MINIMUM_FREQUENCY = 10 #in minute
-
-#TODO rename the fields, do not mix frequency with period :S
 
 class external_cron(Model):
 
     _name = "external.cron"
     _description = "external.cron"
 
-    def _export_management_one_row(self, cr, uid, cron_id, field, arg, context=None):
-        """ set exported et readonly value"""
-        res = {}
-        domain = [('model','=','external.cron'),('res_id','=',cron_id)]
-        my_search = self.pool.get('ir.model.data').search(cr, uid, domain, context=context)
-        if len(my_search) > 0:
-            res[cron_id] = {'exported': True, 'readonly': False}
-        else:
-            res[cron_id] = {'exported': False, 'readonly': False}
-        return res
-
-    def _export_management(self, cr, uid, ids, field, arg, context=None):
-        res={}
-        for cron_id in ids:
-            res.update(self._export_management_one_row(cr, uid, cron_id, field, arg, context=context))
-        return res
-
     _columns = {
         'name': fields.char('Name', size=50, required=True),
-        'active': fields.boolean('Active',
-                help="The active field allows to hide the item in tree view without deleting it."),
+        'active': fields.boolean('Active', help="The active field allows to hide the item in tree view without deleting it."),
         'period': fields.selection((('month','Month'), ('week','Week'), ('day','Day'),
-            ('minute','Minute')), 'Periodicity', required=True,
-                                                help="Base unit periodicity used by cron"),
-        'frequency': fields.integer('Frequency (min.)',
-                                    help="Interval cron in minutes if periodicity is in 'minutes'"),
-        'repeat': fields.datetime('Repeat', help="Recurrency selection with datetime widget : \
-                    if 'periodicity' is 'day' only hour indicate the external data; if is 'week'"),
-        'report_type': fields.selection([('sale','Sale'), ('product','Product')],'Report',
-                                            required=True,  help="Report type name to cron"),
-        'referential_id':fields.many2one('external.referential', 'Referential', required=True,
-                                                                    help="External referential"),
-        'exported': fields.function(_export_management, multi='export', method=True, string='Exported', type='boolean',
-                    help="True if cron has been exported to external application with success and subsequently has an external referential in 'ir.model.data'"),
-        'readonly': fields.function(_export_management, multi='export', type='boolean', method=True, string='Read only', help='define form read only behavior'),
+            ('minute','Minute')), 'Periodicity', help="Base unit periodicity used by cron"),
+        'frequency': fields.integer('Frequency', help="Interval cron in minutes. Set periodicity on 'minute'"),
+        'repeat': fields.datetime('Repeat',
+            help="Recurrency selection with datetime widget : if 'periodicity' is 'day' only hour indicate the external data; if is 'week'  "),
+        'report_type': fields.selection([('sale','Sale'), ('product','Product')],'Report', help="Report type name to cron"),
+        'referential_id':fields.many2one('external.referential', 'Referential', help="External referential"),
     }
 
     _defaults = {
-        'active': 1,
-        'name': 'external cron',
+        'active': 1
     }
 
-#TODO refactor the constraint (only used by the prototype, ebayerpconnect)
-    def _check_field_frequency(self, cr, uid, ids, context=None):
-        for cron in self.browse(cr, uid, ids):
-            if cron.frequency <= EXT_CRON_MINIMUM_FREQUENCY and cron.period == 'minute':
-                raise except_orm(_('Invalid field value :'), _("'Frequency' field must be greater than %s minutes" %EXT_CRON_MINIMUM_FREQUENCY))
-        return True
-
-    def _count_duplicate_report(self, cr, uid, vals, context=None):
-        domain = []
-        for key, val in vals.items():
-            domain.append((key, '=', val))
-        domain.append(('active', '=', 'True'))
-        return len(self.search(cr, uid, domain, context=context))
-
-    def _check_field_active(self, cr, uid, ids, context=None):
-        """ """
-        for cron in self.browse(cr, uid, ids, context=context):
-            vals = {'report_type': cron.report_type, 'referential_id': cron.referential_id.id}
-            if cron.active == True:
-                report_count = self._count_duplicate_report(cr, uid, vals, context=context)
-                if report_count > 1:
-                    raise except_orm(_('Too many reports of the same type for this referential:'),
-                        _("There are %s 'Reports' of '%s' type  with 'active' value checked. \nOnly 1 is authorized!" % (report_count, cron.report_type)))
-        return True
-
-    def copy(self, cr, uid, id, default=None, context=None):
-        row = self.browse(cr, uid, id, context=context)
-        if default is None:
-            default = {}
-        default_custom={'exported': False, 'active': False, 'name': row.name+' copy'}
-        default.update(default_custom)
-        return super(external_cron, self).copy(cr, uid, id, default, context=context)
-
-    _constraints = [
-        (_check_field_frequency, "Error message in raise", ['frequency']),
-        (_check_field_active, "Only one active cron per job", ['active']),
-    ]
-
     def unlink(self, cr, uid, ids, context=None):
         self.ext_unlink(cr, uid, ids, context=context)
         return super(external_cron, self).unlink(cr, uid, ids, context=context)
+

=== modified file 'base_external_cron/external_cron_view.xml'
--- base_external_cron/external_cron_view.xml	2012-12-03 16:26:23 +0000
+++ base_external_cron/external_cron_view.xml	2013-09-02 20:41:47 +0000
@@ -8,7 +8,8 @@
 <openerp>
     <data>
 
-        <!-- FORM -->
+        <!-- VIEWS FOR THE OBJECT : external.cron -->
+        <!-- form -->
         <record id="external_cron_view_form" model="ir.ui.view">
             <field name="name">base_external_cron.external.cron.view_form</field>
             <field name="model">external.cron</field>
@@ -16,22 +17,21 @@
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="external.cron">
-                    <group name="common">
-                        <field name="name" />
-                        <field name="active" attrs="{'readonly':[('readonly','=',True)]}"/>
-                        <field name="period" attrs="{'readonly':[('readonly','=',True)]}"/>
-                        <field name="report_type" attrs="{'readonly':[('readonly','=',True)]}"/>
-                        <field name="repeat" attrs="{'invisible':[('frequency','!=',0),('period','=','minute')], 'required': [('period','!=', 'minute')]}"/>
-                        <field name="frequency" attrs="{'invisible':[('period','!=','minute')],'readonly':[('readonly','=',True)]}"/>
-                        <field name="referential_id" attrs="{'readonly':[('readonly','=',True)]}"/>
-                        <field name="exported" />
-                        <field name="readonly" invisible="1" />
-                    </group>
+                    <field name="name" />
+                    <field name="active" />
+                    <field name="period" />
+                    <field name="frequency" />
+<!--
+                    <field name="repeat" readonly="1" />
+-->
+                    <field name="repeat" />
+                    <field name="report_type" />
+                    <field name="referential_id" />
                 </form>
             </field>
         </record>
 
-        <!-- TREE -->
+        <!-- tree -->
         <record id="external_cron_view_tree" model="ir.ui.view">
             <field name="name">base_external_cron.external.cron.view_tree</field>
             <field name="model">external.cron</field>
@@ -43,28 +43,18 @@
                     <field name="active" />
                     <field name="period" />
                     <field name="report_type" />
-                    <field name="frequency" attrs="{'invisible':[('period','!=','minute')]}"/>
+                    <field name="frequency" />
+                    <field name="repeat" />
                     <field name="referential_id" />
-                    <field name="exported" string="exp."/>
                 </tree>
             </field>
         </record>
 
         <!-- Action used by menu -->
         <record id="action_external_cron" model="ir.actions.act_window">
-            <field name="help">
-'Repeat' field behavior: only visible if 'Periodicity' is in 'Month/Day/Week' -------
-'Repeat' format is 'mm/dd/YYYY HH:MM:SS': example: 12/24/2013 12:05:32  (Tuesday) -------
-If 'Periodicity' is 'Month': next cron will be each 24th day of the month at 12:05:32 -------
-If 'Periodicity' is 'Month' and you set 29, 30 or 31 instead of 24th day next execution always will be the last day of the month-------
-If 'Periodicity' is 'Week': next cron will be each Tuesday at 12:05:32 -------
-If 'Periodicity' is 'Day': next cron will be each day at 12:05:32 ----------------
-If 'Periodicity' is 'Minute': next cron will be each X minutes (depends on 'frequency' field value)------
-            </field>
             <field name="name">External Cron</field>
             <field name="res_model">external.cron</field>
             <field name="view_type">form</field>
-            <field name="context">{'active_test': False}</field>
             <field name="view_mode">tree,form</field>
         </record>
 

=== removed directory 'base_external_dbsource'
=== removed file 'base_external_dbsource/__init__.py'
--- base_external_dbsource/__init__.py	2012-08-06 03:31:18 +0000
+++ base_external_dbsource/__init__.py	1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    Daniel Reis
-#    2011
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import base_external_dbsource
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== removed file 'base_external_dbsource/__openerp__.py'
--- base_external_dbsource/__openerp__.py	2012-09-12 15:19:28 +0000
+++ base_external_dbsource/__openerp__.py	1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    Daniel Reis, 2011 
-#    Additional contributions by Maxime Chambreuil, Savoir-faire Linux
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-{
-    'name': 'External Database Sources',
-    'version': '61.3',
-    'category': 'Tools',
-    'description': """
-This module allows you to define connections to foreign databases using ODBC,
-Oracle Client or SQLAlchemy.
-
-Databases sources can be configured in Settings > Configuration -> Data sources.
-
-Depending on the database, you need:
- * to install unixodbc and python-pyodbc packages to use ODBC connections.
- * to install FreeTDS driver (tdsodbc package) and configure it through ODBC to 
-   connect to Microsoft SQL Server.
- * to install and configure Oracle Instant Client and cx_Oracle python library
-   to connect to Oracle.
-    """,
-    'author': 'Daniel Reis',
-    'website': 'http://launchpad.net/addons-tko',
-    'images': [
-        'images/screenshot01.png',
-    ],
-    'depends': [
-        'base',
-    ],
-    'init': [],
-    'data': [
-        'base_external_dbsource_view.xml',
-        'security/ir.model.access.csv',
-    ],
-    'demo': [
-        'base_external_dbsource_demo.xml',
-    ],
-    'test': [
-        'dbsource_connect.yml',
-    ], 
-    'installable': True,
-    'active': False,
-}
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== removed file 'base_external_dbsource/base_external_dbsource.py'
--- base_external_dbsource/base_external_dbsource.py	2012-09-13 10:08:37 +0000
+++ base_external_dbsource/base_external_dbsource.py	1970-01-01 00:00:00 +0000
@@ -1,159 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    Daniel Reis
-#    2011
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import os
-from osv import fields, osv
-from openerp.tools.translate import _
-import openerp.tools as tools
-import logging
-_logger = logging.getLogger(__name__)
-
-CONNECTORS = []
-
-try:
-    import sqlalchemy
-    import pymssql 
-    CONNECTORS.append( ('mssql', 'Microsoft SQL Server') )
-except:
-        _logger.info('MS SQL Server not available. Please install "slqalchemy" and "pymssql" python package.')
-
-try:
-    import sqlalchemy
-    import MySQLdb
-    CONNECTORS.append( ('mysql', 'MySQL') )
-except:
-    _logger.info('MySQL not available. Please install "slqalchemy" and "mysqldb" python package.')
-
-try:
-    import pyodbc
-    CONNECTORS.append( ('pyodbc', 'ODBC') )
-except:
-    _logger.info('ODBC libraries not available. Please install "unixodbc" and "python-pyodbc" packages.')
-
-try:
-    import cx_Oracle
-    CONNECTORS.append( ('cx_Oracle', 'Oracle') )
-except:
-    _logger.info('Oracle libraries not available. Please install "cx_Oracle" python package.')
-
-import psycopg2
-CONNECTORS.append( ('postgresql', 'PostgreSQL') )
-
-try:
-    import sqlalchemy
-    CONNECTORS.append( ('sqlite', 'SQLite') )
-except:
-    _logger.info('SQLAlchemy not available. Please install "slqalchemy" python package.')
- 
-class base_external_dbsource(osv.osv):
-    _name = "base.external.dbsource"
-    _description = 'External Database Sources'
-    _columns = {
-        'name': fields.char('Datasource name', required=True, size=64),
-        'conn_string': fields.text('Connection string', help="""\
-Sample connection strings:
-- Microsoft SQL Server: mssql+pymssql://username:%s@server:port/dbname?charset=utf8
-- MySQL: mysql://user:%s@server:port/dbname
-- ODBC: DRIVER={FreeTDS};SERVER=server.address;Database=mydb;UID=sa
-- ORACLE: username/%s@//server.address:port/instance
-- PostgreSQL: dbname='template1' user='dbuser' host='localhost' port='5432' password=%s
-- SQLite: sqlite:///test.db
-"""),
-        'password': fields.char('Password' , size=40),
-        'connector': fields.selection(CONNECTORS, 'Connector', required=True,
-            help = "If a connector is missing from the list, check the " \
-                 + "server log to confirm that the required componentes were detected."),
-    }
-
-    def conn_open(self, cr, uid, id1):
-        #Get dbsource record
-        data = self.browse(cr, uid, id1)
-        #Build the full connection string
-        connStr = data.conn_string
-        if data.password:
-            if '%s' not in data.conn_string:
-                connStr += ';PWD=%s'
-            connStr = connStr % data.password
-        #Try to connect
-        if data.connector == 'cx_Oracle':
-            os.environ['NLS_LANG'] = 'AMERICAN_AMERICA.UTF8'
-            conn = cx_Oracle.connect(connStr)
-        elif data.connector == 'pyodbc':
-            conn = pyodbc.connect(connStr)
-        elif data.connector in ('sqlite','mysql','mssql'):
-            conn = sqlalchemy.create_engine(connStr).connect()
-        elif data.connector == 'postgresql':
-            conn = psycopg2.connect(connStr)
-
-        return conn
-
-    def execute(self, cr, uid, ids, sqlquery, sqlparams=None, metadata=False, context=None):
-        """Executes SQL and returns a list of rows. 
-        
-            "sqlparams" can be a dict of values, that can be referenced in the SQL statement
-            using "%(key)s" or, in the case of Oracle, ":key".
-            Example: 
-                sqlquery = "select * from mytable where city = %(city)s and date > %(dt)s"
-                params   = {'city': 'Lisbon', 'dt': datetime.datetime(2000, 12, 31)}
-                
-            If metadata=True, it will instead return a dict containing the rows list and the columns list,
-            in the format:
-                { 'cols': [ 'col_a', 'col_b', ...]
-                , 'rows': [ (a0, b0, ...), (a1, b1, ...), ...] }
-        """
-        data = self.browse(cr, uid, ids)
-        rows, cols = list(), list()
-        for obj in data:
-            conn = self.conn_open(cr, uid, obj.id)
-            if obj.connector in ["sqlite","mysql","mssql"]: 
-                #using sqlalchemy
-                cur = conn.execute(sqlquery, sqlparams)
-                if metadata: cols = cur.keys()
-                rows = [r for r in cur]
-            else: 
-                #using other db connectors
-                cur = conn.cursor()
-                cur.execute(sqlquery, sqlparams)
-                if metadata: cols = [d[0] for d in cur.description]
-                rows = cur.fetchall()
-            conn.close()
-        if metadata: 
-            return{'cols': cols, 'rows': rows}
-        else:
-            return rows
-
-    def connection_test(self, cr, uid, ids, context=None):
-        for obj in self.browse(cr, uid, ids, context):
-            conn = False
-            try:
-                conn = self.conn_open(cr, uid, obj.id)
-            except Exception, e:
-                raise osv.except_osv(_("Connection test failed!"), _("Here is what we got instead:\n %s") % tools.ustr(e))
-            finally:
-                try:
-                    if conn: conn.close()
-                except Exception:
-                    # ignored, just a consequence of the previous exception
-                    pass
-        #TODO: if OK a (wizard) message box should be displayed
-        raise osv.except_osv(_("Connection test succeeded!"), _("Everything seems properly set up!"))
-    
-base_external_dbsource()

=== removed file 'base_external_dbsource/base_external_dbsource_demo.xml'
--- base_external_dbsource/base_external_dbsource_demo.xml	2012-09-12 15:19:28 +0000
+++ base_external_dbsource/base_external_dbsource_demo.xml	1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0"?>
-<openerp>
-    <data>
-
-        <record model="base.external.dbsource" id="demo_postgre">
-            <field name="name">PostgreSQL local</field>
-            <field name="conn_string">dbname='postgres' password=%s</field>
-            <field name="password">postgresql</field>
-            <field name="connector">postgresql</field>
-        </record>
-        
-    </data>
-</openerp>
-
-

=== removed file 'base_external_dbsource/base_external_dbsource_view.xml'
--- base_external_dbsource/base_external_dbsource_view.xml	2012-10-30 21:07:19 +0000
+++ base_external_dbsource/base_external_dbsource_view.xml	1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-<?xml version="1.0"?>
-<openerp>
-    <data>
-
-        <!-- DBSource -->
-
-        <record model="ir.ui.view" id="view_dbsource_tree">
-            <field name="name">base.external.dbsource.tree</field>
-            <field name="model">base.external.dbsource</field>
-            <field name="type">tree</field>
-            <field name="arch" type="xml">
-                <tree string="External DB Sources">
-                    <field name="name"/>
-		    <field name="connector"/>
-		    <field name="conn_string"/>
-                </tree>
-            </field>
-        </record>
-        
-        <record model="ir.ui.view" id="view_dbsource_form">
-            <field name="name">base.external.dbsource.form</field>
-            <field name="model">base.external.dbsource</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <form string="External DB Source">
-                    <field name="name"/>
-                    <field name="password" password="True"/>
-                    <newline/>
-		    <field name="connector" colspan="2"/>
-                    <newline/>
-		    <field name="conn_string" colspan="4"/>
-                    <newline/>
-                    <button name="connection_test" string="Test Connection" type="object" icon="gtk-network" colspan="4"/>
-                </form>
-            </field>
-        </record>
-
-        <record model="ir.actions.act_window" id="action_dbsource">
-            <field name="name">External Database Sources</field>
-            <field name="res_model">base.external.dbsource</field>
-            <field name="view_type">form</field>
-            <field name="view_mode">tree,form</field>
-            <field name="view_id" ref="view_dbsource_tree"/>
-        </record>
-
-        <menuitem name="Database Sources"
-                  id="menu_dbsource" 
-                  parent="base.next_id_9" 
-                  action="action_dbsource"/>
-
-    </data>
-</openerp>
-
-

=== removed directory 'base_external_dbsource/images'
=== removed file 'base_external_dbsource/images/screenshot01.png'
Binary files base_external_dbsource/images/screenshot01.png	2012-08-06 03:31:18 +0000 and base_external_dbsource/images/screenshot01.png	1970-01-01 00:00:00 +0000 differ
=== removed directory 'base_external_dbsource/security'
=== removed file 'base_external_dbsource/security/ir.model.access.csv'
--- base_external_dbsource/security/ir.model.access.csv	2012-08-06 03:31:18 +0000
+++ base_external_dbsource/security/ir.model.access.csv	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_base_external_dbsource_group_system,bae_external_dbsource_group_system,model_base_external_dbsource,base.group_system,1,1,1,1

=== removed directory 'base_external_dbsource/test'
=== removed file 'base_external_dbsource/test/dbsource_connect.yml'
--- base_external_dbsource/test/dbsource_connect.yml	2012-09-12 15:19:28 +0000
+++ base_external_dbsource/test/dbsource_connect.yml	1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
--
-  Connect to local Postgres.
-- 
-  !python {model: base.external.dbsource}: |
-    self.connection_test(cr, uid, [ref("demo_postgresql")]

=== modified file 'base_external_file_protocole/__openerp__.py'
--- base_external_file_protocole/__openerp__.py	2012-12-26 09:58:46 +0000
+++ base_external_file_protocole/__openerp__.py	2013-09-02 20:41:47 +0000
@@ -22,7 +22,7 @@
 
 {
     'name': 'base_external_file_protocole',
-    'version': '6.1.0',
+    'version': '0.1',
     'category': 'Generic Modules/Others',
     'license': 'AGPL-3',
     'description': """
@@ -36,14 +36,11 @@
     'init_xml': [],
     'update_xml': [
         'file_buffer_view.xml',
+        'settings/external.referential.category.csv',
         'file_buffer_data.xml',
-        'external_referential_view.xml',
-        'settings/external.referential.category.csv',
-        'settings/external.referential.type.csv',
-        'settings/external.referential.version.csv',
     ],
     'demo_xml': [],
-    'installable': False,
+    'installable': True,
     'active': False,
 }
 

=== removed file 'base_external_file_protocole/external_referential_view.xml'
--- base_external_file_protocole/external_referential_view.xml	2012-10-09 12:45:26 +0000
+++ base_external_file_protocole/external_referential_view.xml	1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  base_sale_report_synchronizer for OpenERP
-  Copyright (C) 2012 Akretion Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>
-  The licence is in the file __openerp__.py
--->
-
-<openerp>
-    <data>
-        <record id="external_referential_form_view" model="ir.ui.view">
-            <field name="name">base_external_file_protocole.external_referential_form_view</field>
-            <field name="model">external.referential</field>
-            <field name="inherit_id" ref="base_external_referentials.external_referential_form_view" />
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <field name="location" position="after">
-                    <field name="port" attrs="{'invisible': [['type_name', 'not in', ['SFTP', 'FTP']]],
-                                                'required': [['type_name', 'in', ['SFTP', 'FTP']]]}"/>
-                    <field name="home_folder" attrs="{'invisible': [['type_name', 'not in', ['SFTP', 'FTP', 'File System']]]}"/>
-                </field>
-            </field>
-        </record>
-    </data>
-</openerp>

=== modified file 'base_external_file_protocole/external_referentials.py'
--- base_external_file_protocole/external_referentials.py	2012-10-09 12:45:26 +0000
+++ base_external_file_protocole/external_referentials.py	2013-09-02 20:41:47 +0000
@@ -1,4 +1,4 @@
-        # -*- encoding: utf-8 -*-
+    # -*- encoding: utf-8 -*-
 ###############################################################################
 #                                                                             #
 #   file_exchange for OpenERP                                                 #
@@ -24,14 +24,6 @@
 from openerp.osv.osv import except_osv
 from base_file_protocole.base_file_protocole import FileConnection
 from tools.translate import _
-from base_external_referentials.external_referentials import REF_VISIBLE_FIELDS
-
-REF_VISIBLE_FIELDS.update({
-    'SFTP': ['location', 'apiusername', 'apipass'],
-    'FTP': ['location', 'apiusername', 'apipass'],
-})
-
-
 
 class external_referential(Model):
     _inherit = "external.referential"
@@ -41,7 +33,7 @@
             id=id[0]
         referential = self.browse(cr, uid, id, context=context)
         try:
-            return FileConnection(referential.type_id.code, referential.location, referential.apiusername,\
+            return FileConnection(referential.protocole, referential.location, referential.apiusername,\
                             referential.apipass, port=referential. port, allow_dir_creation = True, \
                             home_folder=referential.home_folder)
         except Exception, e:
@@ -49,6 +41,7 @@
                              _("Could not connect to server\nCheck url & user & password.\n %s") % e)
 
     _columns={
+        'protocole': fields.selection([('ftp','ftp'), ('filestore', 'Filestore'), ('sftp', 'sftp')], 'Protocole'),
         'port': fields.integer('Port'),
         'home_folder': fields.char('Home Folder', size=64),
     }
@@ -59,7 +52,10 @@
         return res
 
     def _prepare_external_referential_vals(self, cr, uid, referential, context=None):
-        res = super(external_referential, self)._prepare_external_referential_vals(cr, uid, referential, context=context)
+        # XXX BUG : NameError mapping is not defined
+        res = super(external_referential, self)._prepare_external_referential_vals(cr, uid, mapping, context=context)
         res['protocole'] = referential.protocole
         return res
 
+external_referential()
+

=== modified file 'base_external_file_protocole/file_buffer.py'
--- base_external_file_protocole/file_buffer.py	2012-12-03 16:26:23 +0000
+++ base_external_file_protocole/file_buffer.py	2013-09-02 20:41:47 +0000
@@ -29,31 +29,28 @@
     _name = "file.buffer"
     _description = "File Buffer"
 
+
     _columns = {
         'name': fields.char('Name', size=64),
-        'file_id': fields.char('Exch. file', size=64, help="Exchange id file"),
-        'state': fields.selection((('waiting','Waiting'), ('running','Running'), ('done','Done'),
-                                                                        ('fail','Fail')), 'State'),
+        'file_id': fields.char('Ext. file', size=64),
+        'state': fields.selection((('waiting','Waiting'), ('running','Running'), ('done','Done')), 'State'),
         'active': fields.boolean('Active'),
-        'mapping_id': fields.many2one('external.mapping', 'Mapping'),
-        'job_ended': fields.datetime('Job ended', help="GMT date given by external application"),
-        'referential_id': fields.related('shop_id', 'referential_id', type='many2one',
-                        relation='external.referential', string='Ext. referential', store=True),
+        'mapping_id': fields.many2one('external.mapping', 'Mapping',
+            help=""),
+        'job_ended': fields.datetime('Job ended'),
+        'referential_id': fields.related('mapping_id', 'referential_id', type='many2one', relation='external.referential', string='Ext. referential', store=True),
         #This field add a dependency on sale (maybe move it into an other module if it's problematic)
         'shop_id': fields.many2one('sale.shop', 'Shop'),
-        'direction': fields.selection([('input', 'Input'),('output', 'Output')], 'Direction',
-                                      help='flow direction of the file'),
-        'response': fields.text('Response', help='External application response'),
     }
 
-    _order = 'job_ended desc'
+    _order = 'name desc'
 
     _defaults = {
         'active': 1,
         'state': 'waiting',
     }
 
-    def get_file(self, cr, uid, file_buffer_id, context=None):
+    def get_file(self, cr, uid, file_id, context=None):
         """
         Fonction that return the content of the attachment
         :param int file_id : id of the file buffer
@@ -61,44 +58,13 @@
         :return: the content attachment
         """
         attach_obj = self.pool.get('ir.attachment')
-        attachment_id = attach_obj.search(cr, uid, [('res_model','=','file.buffer'),
-                                                                ('res_id','=', file_buffer_id)])
+        attachment_id = attach_obj.search(cr, uid, [('res_model','=','file.buffer'), ('res_id','=', file_id)])
         if not attachment_id:
             return False
         else:
             attachment = attach_obj.browse(cr, uid, attachment_id[0], context=context)
             return base64.decodestring(attachment.datas)
 
-    def create_file_buffer_attachment(self, cr, uid, file_buffer_id, datas, file_name,
-                                      context=None, extension='csv', prefix_file_name='report'):
-        """
-        Create file attachment to file.buffer object
-        :param int file_buffer_id:
-        :param str datas: file content
-        :param str file_id: file name component
-        :param str extension: file extension
-        :param str prefix_file_name:
-        :rtype: boolean
-        :return: True
-        """
-        if context is None: context = {} 
-        context.update({'default_res_id': file_buffer_id, 'default_res_model': 'file.buffer'})
-        datas_encoded = base64.encodestring(datas)
-        attach_name = prefix_file_name + '_' + file_name + '.' + extension
-        params_attachment = {'name': attach_name, 'datas': datas_encoded,
-                                                                    'datas_fname': attach_name}
-        attachment_id = self.pool.get('ir.attachment').create(cr, uid, params_attachment, context)
-
-        return True
-
-    def check_state_file_buffer_scheduler(self, cr, uid, domain=None, context=None):
-        if not domain: domain = []
-        domain.append(('state', '=', 'running'))
-        ids = self.search(cr, uid, domain, context=context)
-        if ids:
-            return self.check_state(cr, uid, ids, context=context)
-        return True
-
     def run_file_buffer_scheduler(self, cr, uid, domain=None, context=None):
         if not domain: domain = []
         domain.append(('state', '=', 'waiting'))
@@ -115,8 +81,7 @@
         for filebuffer in self.browse(cr, uid, ids, context=context):
             external_session = ExternalSession(filebuffer.referential_id, filebuffer)
             self._run(cr, uid, external_session, filebuffer, context=context)
-            if filebuffer.direction == 'input':
-                filebuffer.done()
+            filebuffer.done()
         return True
 
     def _run(self, cr, uid, external_session, filebuffer, context=None):
@@ -128,7 +93,3 @@
     def _set_state(self, cr, uid, ids, state, context=None):
         for id in ids:
             self.write(cr, uid, id, {'state': state}, context=context)
-
-    def check_state(self, cr, uid, ids, context=None):
-        """ Inherit this function in your module """
-        return True

=== modified file 'base_external_file_protocole/file_buffer_data.xml'
--- base_external_file_protocole/file_buffer_data.xml	2012-09-28 14:16:04 +0000
+++ base_external_file_protocole/file_buffer_data.xml	2013-09-02 20:41:47 +0000
@@ -3,7 +3,7 @@
     <data noupdate="1">
 
         <record forcecreate="True" id="ir_cron_run_file_buffer_scheduler_action" model="ir.cron">
-            <field name="name">File Buffer: process</field>
+            <field name="name">Proccess File Buffer</field>
             <field eval="False" name="active"/>
             <field name="user_id" ref="base.user_root"/>
             <field name="interval_number">10</field>
@@ -15,18 +15,5 @@
             <field eval="'()'" name="args"/>
         </record>
 
-        <record forcecreate="True" id="ir_cron_check_state_file_buffer_scheduler_action" model="ir.cron">
-            <field name="name">File Buffer: check state (output buffer)</field>
-            <field eval="False" name="active"/>
-            <field name="user_id" ref="base.user_root"/>
-            <field name="interval_number">10</field>
-            <field name="interval_type">minutes</field>
-            <field name="numbercall">-1</field>
-            <field eval="False" name="doall"/>
-            <field eval="'file.buffer'" name="model"/>
-            <field eval="'check_state_file_buffer_scheduler'" name="function"/>
-            <field eval="'()'" name="args"/>
-        </record>
-
     </data>
 </openerp>

=== modified file 'base_external_file_protocole/file_buffer_view.xml'
--- base_external_file_protocole/file_buffer_view.xml	2012-10-16 15:50:05 +0000
+++ base_external_file_protocole/file_buffer_view.xml	2013-09-02 20:41:47 +0000
@@ -6,30 +6,21 @@
 
 <openerp>
     <data>
-<!-- SEARCH -->
+
 <record id="file_buffer_view_search" model="ir.ui.view">
     <field name="name">file.buffer.search</field>
     <field name="model">file.buffer</field>
     <field name="type">search</field>
     <field name="arch" type="xml">
-        <search string="Search Files Buffer">
-            <group>
-                <filter icon="kanban-pause" name="wait" string="Waiting" domain="[('state','=','waiting')]"/>
-                <filter icon="gtk-apply" string="Done" domain="[('state','=','done')]"/>
-                <filter icon="gtk-execute" string="Running" domain="[('state','=','running')]"/>
-                <filter icon="terp-gtk-stop" string="Fail" domain="[('state','=','fail')]"/>
-            </group>
-            <group>
-                <filter icon="gtk-go-down" string="In" domain="[('direction','=','input')]"/>
-                <filter icon="gtk-go-up" string="Out" domain="[('direction','=','output')]"/>
-                <field name="name" />
-                <field name="file_id" string="Exchange file"/>
-            </group>
+        <search string="Search Sales Order">
+            <filter icon="terp-document-new" name="wait" string="Waiting" domain="[('state','=','waiting')]"/>
+            <filter icon="terp-check" string="Done" domain="[('state','=','done')]"/>
        </search>
     </field>
 </record>
 
-<!-- FORM -->
+
+<!-- VIEW FOR THE OBJECT : file_buffer -->
 <record id="file_buffer_view_form" model="ir.ui.view">
     <field name="name">file_buffer.file_buffer.view_form</field>
     <field name="model">file.buffer</field>
@@ -38,26 +29,18 @@
     <field name="arch" type="xml">
     <form string="file_buffer">
         <field name="name" />
-        <field name="state" readonly="1"/>
+        <field name="state" />
         <field name="mapping_id" />
         <field name="file_id" />
-        <field name="referential_id" readonly="1"/>
+        <field name="referential_id"/>
         <field name="shop_id"/>
         <field name="job_ended" />
         <field name="active"/>
-        <field name="direction" readonly="1" />
-        <newline />
-        <button name="run" string="Run" colspan="2" type="object" attrs="{'invisible':[('state','in', ('running','done'))]}"/>
-        <newline />
-        <button name="check_state" string="Check state" colspan="2" type="object" attrs="{'invisible':[('state','!=', 'running')]}"/>
-        <newline />
-        <separator string="External application response (for output direction)" colspan="4"/>
-        <field name="response" nolabel="1" readonly="1" colspan="4" />
+        <button name="run" string="Run" colspan="2" type="object" />
     </form>
     </field>
 </record>
 
-<!-- TREE -->
 <record id="file_buffer_view_tree" model="ir.ui.view">
     <field name="name">file_buffer.file_buffer.view_tree</field>
     <field name="model">file.buffer</field>
@@ -71,7 +54,6 @@
             <field name="mapping_id" />
             <field name="file_id" />
             <field name="job_ended" />
-            <field name="direction" string="direct." />
             <field name="referential_id" string="ex ref"/>
             <button name="run" string="Run" icon="gtk-go-forward" type="object"/>
         </tree>

=== removed file 'base_external_file_protocole/settings/external.referential.type.csv'
--- base_external_file_protocole/settings/external.referential.type.csv	2012-10-09 12:45:26 +0000
+++ base_external_file_protocole/settings/external.referential.type.csv	1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-id,name,categ_id:id,code
-t-sftp,SFTP,file-protocole,sftp
-t-ftp,FTP,file-protocole,ftp
-t-filesystem,File System,file-protocole,filesystem

=== removed file 'base_external_file_protocole/settings/external.referential.version.csv'
--- base_external_file_protocole/settings/external.referential.version.csv	2012-10-11 11:11:15 +0000
+++ base_external_file_protocole/settings/external.referential.version.csv	1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-type_id:id,id,name,code
-t-sftp,v-stfp,.,.
-t-ftp,v-ftp,.,.
-t-filesystem,v-filesystem,.,.

=== modified file 'base_external_referentials/__openerp__.py'
--- base_external_referentials/__openerp__.py	2012-12-26 09:58:46 +0000
+++ base_external_referentials/__openerp__.py	2013-09-02 20:41:47 +0000
@@ -23,7 +23,7 @@
 
 {
     'name': 'Base External Referentials',
-    'version': '6.1.0',
+    'version': '1.0',
     'category': 'Generic Modules/Base',
     'description': """
 Definition : a referential is an external system that will interacts with OpenERP
@@ -48,7 +48,7 @@
     """,
     'author': 'Raphaël Valyi (Akretion.com), Sharoon Thomas (Openlabs.co.in)',
     'website': 'http://www.akretion.com, http://openlabs.co.in/',
-    'depends': ['base','base_pop_up', 'base_file_protocole', 'email_template'],
+    'depends': ['base','base_pop_up'],
     'init_xml': [],
     'update_xml': [
         'external_referentials_view.xml',
@@ -57,10 +57,9 @@
         'security/ir.model.access.csv',
         'group_fields_view.xml',
         'security/base_external_referentials_security.xml',
-        'report_mail_template.xml',
     ],
     'demo_xml': [],
-    'installable': False,
+    'installable': True,
     'certificate': '',
 }
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'base_external_referentials/decorator.py'
--- base_external_referentials/decorator.py	2012-12-26 09:52:50 +0000
+++ base_external_referentials/decorator.py	2013-09-02 20:41:47 +0000
@@ -71,7 +71,7 @@
             external_session.logger.debug(_("There is no key report_id in the context, error will be not catch"))
             return func(self, cr, uid, external_session, resource, *args, **kwargs)
         if context.get('report_line_based_on'):
-            if not context['report_line_based_on'] == self._name:
+            if context is None['report_line_based_on'] == self._name:
                 return func(self, cr, uid, external_session, resource, *args, **kwargs)
         report_line_obj = self.pool.get('external.report.line')
         report_line_id = report_line_obj.start_log(
@@ -119,10 +119,10 @@
         return response
     return wrapper
 
-#This decorator is for now a prototype it will be improve latter, maybe the best will to have two kind of decorator (import and export)
+#This decorator is for now a prototype it will be improve latter, maybe the best will to have to kind of decorator (import and export)
 def catch_action(func):
     """ This decorator open and close a new cursor and if an error occure it will generate a error line in the reporting system
-    The function must start with "self, cr, uid, object_id"
+    The function must start with "self, cr, uid, object"
     And the object must have a field call "referential_id" related to the object "external.referential"
     """
     @functools.wraps(func)

=== modified file 'base_external_referentials/external_osv.py'
--- base_external_referentials/external_osv.py	2013-02-05 14:51:09 +0000
+++ base_external_referentials/external_osv.py	2013-09-02 20:41:47 +0000
@@ -24,9 +24,6 @@
 from openerp.osv.orm import Model
 from openerp.osv.osv import except_osv
 import base64
-import urllib
-import time
-import netsvc
 from datetime import datetime
 import logging
 from lxml import objectify
@@ -102,7 +99,7 @@
 class ExternalSession(object):
     def __init__(self, referential, sync_from_object=None):
         """External Session in an object to store the information about a connection with an
-        external system, like Magento, Prestashop, Ebay, ftp....
+        extenal system, like Magento, Prestashop, Ebay, ftp....
         This class have for fields
         - referential_id : a many2one related to the referential used for this connection
         - sync_from_object : a many2one related to the object that launch the synchronization
@@ -270,15 +267,15 @@
     if res is not False:
         return res
     else:
-        external_session.logger.info(('Missing external resource for object %s'
-        ' with openerp id %s. Exporting on the fly')%(self._name, openerp_id))
         return self._export_one_resource(cr, uid, external_session, openerp_id, context=context)
 
 @extend(Model)
 def get_extid(self, cr, uid, openerp_id, referential_id, context=None):
     """Returns the external id of a resource by its OpenERP id.
+    Return False If not external id have been found
     :param int openerp_id : openerp id of the resource
     :param int referential_id : referential id
+    :return: the external id of the resource or False if not exist
     :rtype: int
     """
     if isinstance(openerp_id, list):
@@ -356,8 +353,6 @@
         existing_id = self.get_oeid(cr, uid, external_id, external_session.referential_id.id, context=context)
         if existing_id:
             return existing_id
-        external_session.logger.info(('Missing openerp resource for object %s'
-        ' with external_id %s. Importing on the fly')%(self._name, external_id))
         return self._import_one_resource(cr, uid, external_session, external_id, context=context)
     return False
 
@@ -666,12 +661,11 @@
     :rtype: int
     """
     resources = self._get_external_resources(cr, uid, external_session, external_id, context=context)
-    defaults = self._get_default_import_values(cr, uid, external_session, context=context)
     if isinstance(resources, list):
-        res = self._record_external_resources(cr, uid, external_session, resources, defaults=defaults, context=context)
+        res = self._record_external_resources(cr, uid, external_session, resources, context=context)
         id = res['write_ids'][0] if res.get('write_ids') else res['create_ids'][0]
     else:
-        res = self._record_one_external_resource(cr, uid, external_session, resources, defaults=defaults, context=context)
+        res = self._record_one_external_resource(cr, uid, external_session, resources, context=context)
         if res.get('write_id'):
             id = res.get('write_id')
         else:
@@ -691,7 +685,6 @@
     :rtype: dict
     :return: dictionary with the key "create_ids" and "write_ids" which containt the id created/written
     """
-    if context is None: context = {}
     result = {'write_ids': [], 'create_ids': []}
     mapping, mapping_id = self._init_mapping(cr, uid, external_session.referential_id.id, mapping=mapping, mapping_id=mapping_id, context=context)
     if mapping[mapping_id]['key_for_external_id']:
@@ -955,8 +948,6 @@
     :rtype: tuple
     :return: an tuple of ids and ids_2_dates (dict with key => 'id' and val => 'last_update_date')
     """
-    if ids in [[], ()]:
-        return [], {}
     query, params = self._get_query_and_params_for_ids_and_date(cr, uid, external_session, ids=ids, last_exported_date=last_exported_date, context=context)
     cr.execute(query, params)
     read = cr.dictfetchall()
@@ -1199,10 +1190,9 @@
                 fields = translatable_fields
             ctx['lang'] = lang
 
-        if fields:
-            for resource in self.read(cr, uid, ids, fields, context=ctx):
-                if not resources.get(resource['id']): resources[resource['id']] = {}
-                resources[resource['id']][lang] = resource
+        for resource in self.read(cr, uid, ids, fields, context=ctx):
+            if not resources.get(resource['id']): resources[resource['id']] = {}
+            resources[resource['id']][lang] = resource
         first = False
     return resources
 
@@ -1220,7 +1210,7 @@
             if inherits_group_ids:
                 search_filter = ['|', ['x_last_update', '>=', last_exported_date], ['%s.x_last_update'%self._inherits[self._inherits.keys()[0]], '>=', last_exported_date]]
         if inherits_group_ids:
-		search_filter = [['%s.x_last_update'%self._inherits[self._inherits.keys()[0]], '>=', last_exported_date]]
+            search_filter = [['%s.x_last_update'%self._inherits[self._inherits.keys()[0]], '>=', last_exported_date]]
         resource_ids_full_read = self.search(cr, uid, search_filter, context=context)
         resource_ids_partial_read = [id for id in ids if not id in resource_ids_full_read]
     else:
@@ -1308,14 +1298,7 @@
 # XXX move to connector or referential
 @extend(Model)
 def create_external_id_vals(self, cr, uid, existing_rec_id, external_id, referential_id, context=None):
-    """
-    Add the external id in the table ir_model_data
-    :param id existing_rec_id: erp id object
-    :param id external_id: external application id
-    :param id referential_id: external id
-    :rtype: int
-    :return:
-    """
+    """Add the external id in the table ir_model_data"""
     ir_model_data_vals = \
     self._prepare_external_id_vals(cr, uid, existing_rec_id,
                                    external_id, referential_id,
@@ -1549,14 +1532,6 @@
             if not hasattr(casted_field, '__iter__'):
                 casted_field = (casted_field,)
             field = list(casted_field)
-        elif external_type == 'url' and internal_type == "binary":
-            (filename, header) = urllib.urlretrieve(field_value)
-            try:
-                f = open(filename , 'rb')
-                data = f.read()
-            finally:
-                f.close()
-            return base64.encodestring(data)
         else:
             if external_type == 'float' and isinstance(field_value, (str, unicode)):
                 field_value = field_value.replace(',','.')
@@ -1741,3 +1716,7 @@
 #                                           END GENERIC TRANSFORM FEATURES
 #
 ########################################################################################################################
+
+
+
+

=== modified file 'base_external_referentials/external_referentials.py'
--- base_external_referentials/external_referentials.py	2013-02-05 14:51:09 +0000
+++ base_external_referentials/external_referentials.py	2013-09-02 20:41:47 +0000
@@ -153,7 +153,7 @@
         'external_field': fields.char('External Field', size=128),
         'type': fields.selection([('in_out', 'External <-> OpenERP'), ('in', 'External -> OpenERP'), ('out', 'External <- OpenERP')], 'Type'),
         'evaluation_type': fields.selection([('function', 'Function'), ('sub-mapping','Sub Mapping Line'), ('direct', 'Direct Mapping')], 'Evalution Type', required=True),
-        'external_type': fields.selection([('url', 'URL'), ('datetime', 'Datetime'), ('unicode', 'String'), ('bool', 'Boolean'), ('int', 'Integer'), ('float', 'Float'), ('list', 'List'), ('dict', 'Dictionnary')], 'External Type', required=True),
+        'external_type': fields.selection([('datetime', 'Datetime'), ('unicode', 'String'), ('bool', 'Boolean'), ('int', 'Integer'), ('float', 'Float'), ('list', 'List'), ('dict', 'Dictionnary')], 'External Type', required=True),
         'datetime_format': fields.char('Datetime Format', size=32),
         'in_function': fields.text('Import in OpenERP Mapping Python Function'),
         'out_function': fields.text('Export from OpenERP Mapping Python Function'),
@@ -345,8 +345,8 @@
         'type_id': fields.related('version_id', 'type_id', type='many2one', relation='external.referential.type', string='External Type'),
         'type_name': fields.related('type_id', 'name', type='char', string='External Type Name',
                                     store=True),
-        'categ_id': fields.related('type_id', 'categ_id', type='many2one', relation='external.referential.category', string='External Category', readonly=True),
-        'categ_name': fields.related('categ_id', 'name', type='char', size=64, string='External Category Name', readonly=True),
+        'categ_id': fields.related('type_id', 'categ_id', type='many2one', relation='external.referential.category', string='External Category'),
+        'categ_name': fields.related('categ_id', 'name', type='char', string='External Category Name'),
         'version_id': fields.many2one('external.referential.version', 'Referential Version', required=True),
         'location': fields.char('Location', size=200),
         'apiusername': fields.char('User Name', size=64),
@@ -692,20 +692,13 @@
         ('ref_template_uniq', 'unique (referential_id, template_id)', 'A referential can not have various mapping imported from the same template')
     ]
 
-    def copy(self, cr, uid, id, default=None, context=None):
-        if default is None:
-            default = {}
-
-        default['template_id'] = False
-
-        return super(external_mapping, self).copy(cr, uid, id, default=default, context=context)
 
 class external_mapping_line(Model): # FIXME : tidy up this remnant of old OERP version
     _inherit = 'external.mapping.line'
 
     _columns = {
         'template_id': fields.many2one('external.mappinglines.template', 'External Mapping Lines Template'),
-        'referential_id': fields.related('mapping_id', 'referential_id', type='many2one', relation='external.referential', string='Referential', store=True),
+        'referential_id': fields.related('mapping_id', 'referential_id', type='many2one', relation='external.referential', string='Referential'),
         'field_id': fields.many2one('ir.model.fields', 'OpenERP Field', ondelete='cascade'),
         'internal_field': fields.related('field_id', 'name', type='char', relation='ir.model.field', string='Field name',readonly=True),
         'external_field': fields.char('External Field', size=128, help=("When importing flat csv file from file exchange,"
@@ -713,7 +706,7 @@
         'mapping_id': fields.many2one('external.mapping', 'External Mapping', ondelete='cascade'),
         'related_model_id': fields.related('mapping_id', 'model_id', type='many2one', relation='ir.model', string='Related Model'),
         'type': fields.selection([('in_out', 'External <-> OpenERP'), ('in', 'External -> OpenERP'), ('out', 'External <- OpenERP')], 'Type'),
-        'external_type': fields.selection([('url', 'URL'),('datetime', 'Datetime'), ('unicode', 'String'), ('bool', 'Boolean'), ('int', 'Integer'), ('float', 'Float'), ('list', 'List'), ('dict', 'Dictionnary')], 'External Type', required=True),
+        'external_type': fields.selection([('datetime', 'Datetime'), ('unicode', 'String'), ('bool', 'Boolean'), ('int', 'Integer'), ('float', 'Float'), ('list', 'List'), ('dict', 'Dictionnary')], 'External Type', required=True),
         'datetime_format': fields.char('Datetime Format', size=32),
         'evaluation_type': fields.selection([('function', 'Function'), ('sub-mapping','Sub Mapping Line'), ('direct', 'Direct Mapping')], 'Evalution Type', required=True),
         'in_function': fields.text('Import in OpenERP Mapping Python Function'),
@@ -765,14 +758,6 @@
             line_id = (version_code + '_' + mapping_name + '_' + line_name).replace('.','_')
         return line_id
 
-    def copy(self, cr, uid, id, default=None, context=None):
-        if default is None:
-            default = {}
-
-        default['template_id'] = False
-
-        return super(external_mapping_line, self).copy(cr, uid, id, default=default, context=context)
-
 
 class ir_model_data(Model):
     _inherit = "ir.model.data"
@@ -811,6 +796,6 @@
     }
 
     _sql_constraints = [
-        ('external_reference_uniq_per_object', 'unique(model, res_id, referential_id)', 'You cannot have on record with multiple external id for a same referential'),
+        ('external_reference_uniq_per_object', 'unique(model, res_id, referential_id)', 'You cannot have on record with multiple external id for a sae referential'),
     ]
 

=== modified file 'base_external_referentials/external_referentials_menu.xml'
--- base_external_referentials/external_referentials_menu.xml	2012-10-21 23:07:16 +0000
+++ base_external_referentials/external_referentials_menu.xml	2013-09-02 20:41:47 +0000
@@ -16,7 +16,8 @@
             <field name="search_view_id" ref="external_referential_search_view"/>
         </record>
 
-        <menuitem id="menu_external_referential" name="External Referentials" parent="ir_ui_menu_external_referentials" action="act_window_external_referential"/>
+        <menuitem id="menu_external_referential" name="External Referentials" parent="ir_ui_menu_external_referentials" />
+        <menuitem id="menu_all_external_referential" name="All Referentials" parent="menu_external_referential" action="act_window_external_referential" />
         <!-- External Referentials Types -->
 
         <record id="ir_actions_act_window_external_type" model="ir.actions.act_window">

=== modified file 'base_external_referentials/external_referentials_view.xml'
--- base_external_referentials/external_referentials_view.xml	2012-10-16 15:58:44 +0000
+++ base_external_referentials/external_referentials_view.xml	2013-09-02 20:41:47 +0000
@@ -41,11 +41,9 @@
                         <separator string="Core Components" colspan="4" />
                         <notebook colspan="4">
                             <page string="Referential Actions">
-                                <group name="compulsory" col="4" colspan="4">
-                                    <separator string="Compulsory" colspan="4" />
-                                    <button name="refresh_mapping" string="1 - Reload Referential Mapping Templates" colspan="2" type="object" />
-                                    <button name="import_referentials" string="2 - Synchronize Referential Settings" colspan="2" type="object" attrs="{'readonly':[('mapping_ids','=',[])]}"/>
-                                </group>
+                                <separator string="Compulsory" colspan="4" />
+                                <button name="refresh_mapping" string="1 - Reload Referential Mapping Templates" colspan="2" type="object" />
+                                <button name="import_referentials" string="2 - Synchronize Referential Settings" colspan="2" type="object" attrs="{'readonly':[('mapping_ids','=',[])]}"/>
                             </page>
                             <page string="CSV file generation" groups="base_external_referentials.group_export_mapping" >
                                 <button name="build_external_ref_categ" string="1- Export category" colspan="1" type="object" />

=== removed file 'base_external_referentials/i18n/fr.po'
--- base_external_referentials/i18n/fr.po	2013-02-04 15:59:06 +0000
+++ base_external_referentials/i18n/fr.po	1970-01-01 00:00:00 +0000
@@ -1,1070 +0,0 @@
-# Translation of OpenERP Server.
-# This file contains the translation of the following modules:
-#	* base_external_referentials
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: OpenERP Server 6.1\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-10-24 13:11+0000\n"
-"PO-Revision-Date: 2012-10-24 13:11+0000\n"
-"Last-Translator: <Benoît Guillot>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: base_external_referentials
-#: field:external.referential.type,code:0
-#: field:external.referential.version,code:0
-msgid "code"
-msgstr "code"
-
-#. module: base_external_referentials
-#: view:external.mapping.line:0
-msgid "Mapping line"
-msgstr "Ligne de mapping"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,selected:0
-msgid "Selected"
-msgstr "Sélectionné"
-
-#. module: base_external_referentials
-#: help:external.mapping.line,external_field:0
-msgid "When importing flat csv file from file exchange,you can leave this field empty, because this field doesn't exist in your csv file'"
-msgstr "Lors de l'import d'un fichier csv plat depuis file_exchange, vous pouvez laisser ce champ vide parce qu'il n'existe pas dans votre fichier csv."
-
-#. module: base_external_referentials
-#: model:ir.model,name:base_external_referentials.model_external_referential_type
-msgid "External Referential Type (Ex.Magento,Spree)"
-msgstr "Type de référentiel externe (Ex.Magento,Spree)"
-
-#. module: base_external_referentials
-#: view:group.fields:0
-#: model:ir.actions.act_window,name:base_external_referentials.group_field_action_open_form
-msgid "Group fields"
-msgstr "Champs groupés"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "CSV file generation"
-msgstr "Génération de fichiers CSV"
-
-#. module: base_external_referentials
-#: view:external.report.line:0
-msgid "Action On Model"
-msgstr "Action sur le modèle"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:413
-#, python-format
-msgid "The method _get_external_resource_ids is not implemented in abstract base module!"
-msgstr "La méthode _get_external_resource_ids n'est pas implémentée dans le module d'abstraction!"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:1468
-#, python-format
-msgid "Wrong external type for mapping %s. One2Many object must have for external type string or integer"
-msgstr "Mauvais type externe pour le mapping %s. Les objects One2Many doivent avoir pour type externe string ou integer"
-
-#. module: base_external_referentials
-#: field:external.report.line,args:0
-msgid "Args"
-msgstr "Args"
-
-#. module: base_external_referentials
-#: sql_constraint:ir.model.data:0
-msgid "You cannot have multiple records with the same external ID in the same module!"
-msgstr "Vous ne pouvez pas avoir plusieurs enregistrements avec le même ID externe dans le même module!"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,related_model_id:0
-msgid "Related Model"
-msgstr "Modèle lié"
-
-#. module: base_external_referentials
-#: model:ir.actions.act_window,name:base_external_referentials.ext_sale_order
-msgid "External Order"
-msgstr "Commande externe"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:94
-#, python-format
-msgid "The method %s already exist. Please change the prefix name"
-msgstr "La méthode %s existe déjà. Veuillez changer le nom préfixé"
-
-#. module: base_external_referentials
-#: field:external.mapping,model:0
-#: field:external.mapping.template,model:0
-msgid "Model Name"
-msgstr "Nom du modèle"
-
-#. module: base_external_referentials
-#: field:external.report,history_ids:0
-msgid "History"
-msgstr "Historique"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "Compulsory"
-msgstr "Obligatoire"
-
-#. module: base_external_referentials
-#: view:external.report:0
-msgid "Retry All Failed"
-msgstr "Réessayer tous les échecs"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:1467
-#: code:addons/base_external_referentials/external_osv.py:1698
-#: code:addons/base_external_referentials/group_fields.py:68
-#, python-format
-msgid "User Error"
-msgstr "Erreur utilisateur"
-
-#. module: base_external_referentials
-#: model:ir.model,name:base_external_referentials.model_external_mapping_template
-msgid "The source mapping records"
-msgstr "Enregistrement du mapping source"
-
-#. module: base_external_referentials
-#: view:external.referential.type:0
-msgid "External Referential Types"
-msgstr "Types de référentiel externe"
-
-#. module: base_external_referentials
-#: model:ir.actions.act_window,name:base_external_referentials.ir_actions_act_window_external_mapping_line
-#: model:ir.ui.menu,name:base_external_referentials.ir_ui_menu_external_mapping_lines
-msgid "External Mapping Lines"
-msgstr "Lignes de mapping externes"
-
-#. module: base_external_referentials
-#: field:external.referential,categ_id:0
-#: model:ir.actions.act_window,name:base_external_referentials.ext_product_category
-msgid "External Category"
-msgstr "Catégorie externe"
-
-#. module: base_external_referentials
-#: model:ir.model,name:base_external_referentials.model_ir_model
-msgid "Models"
-msgstr "Modèles"
-
-#. module: base_external_referentials
-#: view:external.report.history:0
-#: view:external.report.line:0
-msgid "Report"
-msgstr "Rapport"
-
-#. module: base_external_referentials
-#: model:ir.model,name:base_external_referentials.model_external_referential_category
-msgid "External Referential Category (Ex: e-commerce, crm, warehouse)"
-msgstr "Catégorie du référentiel externe (Ex: e-commerce, crm, entrepôt)"
-
-#. module: base_external_referentials
-#: view:external.mapping.line:0
-msgid "Other Information"
-msgstr "Autre information"
-
-#. module: base_external_referentials
-#: field:external.referential,debug:0
-msgid "Debug"
-msgstr "Debug"
-
-#. module: base_external_referentials
-#: view:external.report.history:0
-#: view:external.report.line:0
-msgid "Failures"
-msgstr "Echecs"
-
-#. module: base_external_referentials
-#: model:ir.model,name:base_external_referentials.model_external_mappinglines_template
-msgid "The source mapping line records"
-msgstr "Enregistrement de la ligne de mapping source"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "2- Export type"
-msgstr "2- Export du type de référentiel"
-
-#. module: base_external_referentials
-#: field:external.mapping,external_done_method:0
-#: field:external.mapping.template,external_done_method:0
-msgid "Done Method"
-msgstr "Méthode de finalisation"
-
-#. module: base_external_referentials
-#: model:ir.model,name:base_external_referentials.model_external_mapping_line
-msgid "Field Mapping"
-msgstr "Mapping du champ"
-
-#. module: base_external_referentials
-#: field:external.referential.version,name:0
-msgid "name"
-msgstr "Nom"
-
-#. module: base_external_referentials
-#: constraint:external.referential:0
-msgid "The name cannot contain a dot!"
-msgstr "Le nom ne doit pas contenir de point!"
-
-#. module: base_external_referentials
-#: model:ir.actions.act_window,name:base_external_referentials.ir_actions_act_window_external_type
-#: model:ir.ui.menu,name:base_external_referentials.ir_ui_menu_external_types
-msgid "External Referentials Types"
-msgstr "Types de référentiels externes"
-
-#. module: base_external_referentials
-#: field:external.mapping,related_model_ids:0
-msgid "Related Inherited Models"
-msgstr "Modèles liés hérités"
-
-#. module: base_external_referentials
-#: view:external.report:0
-msgid "External Referential Reports"
-msgstr "Rapports des référentiels externes"
-
-#. module: base_external_referentials
-#: field:external.mapping,external_create_method:0
-#: field:external.mapping.template,external_create_method:0
-msgid "Create Method"
-msgstr "Méthode de création"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,external_type:0
-#: selection:external.mappinglines.template,external_type:0
-msgid "Datetime"
-msgstr "Datetime"
-
-#. module: base_external_referentials
-#: field:ir.model.data,referential_id:0
-msgid "Ext. Referential"
-msgstr "Référentiel externe"
-
-#. module: base_external_referentials
-#: help:external.mapping.line,selected:0
-msgid "to select for mapping"
-msgstr "A selectionner pour mapper"
-
-#. module: base_external_referentials
-#: field:external.referential,version_id:0
-msgid "Referential Version"
-msgstr "Version du référentiel"
-
-#. module: base_external_referentials
-#: view:external.report.line:0
-msgid "Retry"
-msgstr "Réessayer"
-
-#. module: base_external_referentials
-#: field:external.report.history,end_date:0
-msgid "End Date"
-msgstr "Date de fin"
-
-#. module: base_external_referentials
-#: selection:external.report.line,state:0
-msgid "Failed"
-msgstr "Echecs"
-
-#. module: base_external_referentials
-#: view:external.mapping:0
-#: field:external.mapping.line,referential_id:0
-msgid "Referential"
-msgstr "Référentiel"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "Referential Actions"
-msgstr "Actions du référentiel"
-
-#. module: base_external_referentials
-#: field:external.referential,location:0
-msgid "Location"
-msgstr "Emplacement"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,evaluation_type:0
-#: selection:external.mappinglines.template,evaluation_type:0
-msgid "Sub Mapping Line"
-msgstr "Ligne de sous-mapping"
-
-#. module: base_external_referentials
-#: field:external.report,failed_line_ids:0
-msgid "Failed Report Lines"
-msgstr "Lignes de rapport en échecs"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,external_type:0
-#: selection:external.mappinglines.template,external_type:0
-msgid "Dictionnary"
-msgstr "Dictionnary"
-
-#. module: base_external_referentials
-#: field:external.mapping,key_for_external_id:0
-#: field:external.mapping.template,key_for_external_id:0
-msgid "External field used as key"
-msgstr "Champ externe utilisé comme clé"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,type:0
-#: field:external.mappinglines.template,type:0
-#: field:external.referential.version,type_id:0
-msgid "Type"
-msgstr "Type"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,field_id:0
-#: field:external.mappinglines.template,field_id:0
-msgid "OpenERP Field"
-msgstr "Champ d'OpenERP"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,name:0
-#: field:external.mappinglines.template,name:0
-#: field:external.referential,name:0
-#: field:external.referential.category,name:0
-#: field:external.referential.type,name:0
-#: field:external.report,name:0
-#: field:group.fields,name:0
-msgid "Name"
-msgstr "Nom"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,type:0
-#: selection:external.mappinglines.template,type:0
-msgid "External -> OpenERP"
-msgstr "Externe -> OpenERP"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,external_type:0
-#: selection:external.mappinglines.template,external_type:0
-msgid "String"
-msgstr "String"
-
-#. module: base_external_referentials
-#: field:external.referential,create_date:0
-msgid "Creation Date"
-msgstr "Date de création"
-
-#. module: base_external_referentials
-#: view:external.report.line:0
-#: field:external.report.line,error_message:0
-msgid "Error Message"
-msgstr "Message d'erreur"
-
-#. module: base_external_referentials
-#: field:external.mapping,external_get_method:0
-#: field:external.mapping.template,external_get_method:0
-msgid "Get Method"
-msgstr "Méthode d'optention"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/group_fields.py:68
-#, python-format
-msgid "Changing Column name is not supported yet"
-msgstr "Le changement de nom de colonne n'est pas supporté pour l'instant"
-
-#. module: base_external_referentials
-#: field:external.mapping,extra_name:0
-#: field:external.mapping.template,extra_name:0
-msgid "Extra Name"
-msgstr "Nom supplémentaire"
-
-#. module: base_external_referentials
-#: view:external.mapping.line:0
-msgid "Internal fields"
-msgstr "Field interne"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "Configuration"
-msgstr "Configuration"
-
-#. module: base_external_referentials
-#: model:ir.ui.menu,name:base_external_referentials.ir_ui_menu_group_fields
-msgid "Group Fields"
-msgstr "Groupe de champs"
-
-#. module: base_external_referentials
-#: field:external.mapping,mapping_ids:0
-msgid "Mappings Lines"
-msgstr "Lignes de mapping"
-
-#. module: base_external_referentials
-#: field:ir.model.fields,group_fields_id:0
-msgid "Trigger Group"
-msgstr "Trigger Group"
-
-#. module: base_external_referentials
-#: field:external.mapping,template_id:0
-msgid "External Mapping Template"
-msgstr "Template de mapping"
-
-#. module: base_external_referentials
-#: field:external.referential.type,version_ids:0
-msgid "Versions"
-msgstr "Versions"
-
-#. module: base_external_referentials
-#: view:external.report:0
-#: model:ir.actions.act_window,name:base_external_referentials.ir_actions_act_window_external_report
-msgid "External Reports"
-msgstr "Rapports externes"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:1432
-#, python-format
-msgid "Invalid format for the variable result."
-msgstr "Le format de la variable result est incorrect."
-
-#. module: base_external_referentials
-#: field:external.report.line,traceback:0
-msgid "Traceback"
-msgstr "Traceback"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,type:0
-#: selection:external.mappinglines.template,type:0
-msgid "External <- OpenERP"
-msgstr "Externe <- OpenERP"
-
-#. module: base_external_referentials
-#: field:external.mapping,referential_id:0
-#: view:external.referential:0
-#: view:external.referential.type:0
-#: view:external.report:0
-#: field:external.report,referential_id:0
-#: model:ir.model,name:base_external_referentials.model_external_referential
-msgid "External Referential"
-msgstr "Référentiel externe"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,child_mapping_id:0
-#: field:external.mappinglines.template,child_mapping_id:0
-msgid "Child Mapping"
-msgstr "Mapping enfant"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,sequence:0
-#: field:external.mappinglines.template,sequence:0
-msgid "Sequence"
-msgstr "Séquence"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/decorator.py:64
-#: code:addons/base_external_referentials/decorator.py:78
-#: code:addons/base_external_referentials/external_osv.py:413
-#: code:addons/base_external_referentials/external_osv.py:962
-#, python-format
-msgid "Not Implemented"
-msgstr "Non implémenté"
-
-#. module: base_external_referentials
-#: view:external.report.line:0
-#: field:external.report.line,resource:0
-#: field:external.report.line,resource_text:0
-msgid "External Data"
-msgstr "Données externe"
-
-#. module: base_external_referentials
-#: view:external.mapping.line:0
-#: field:external.referential.version,full_name:0
-msgid "Full Name"
-msgstr "Nom entier"
-
-#. module: base_external_referentials
-#: field:external.referential,categ_name:0
-msgid "External Category Name"
-msgstr "Nom de la catégorie du référentiel"
-
-#. module: base_external_referentials
-#: view:external.mapping.line:0
-#: field:external.mapping.line,in_function:0
-#: field:external.mappinglines.template,in_function:0
-msgid "Import in OpenERP Mapping Python Function"
-msgstr "Import in OpenERP Mapping Python Function"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,evaluation_type:0
-#: selection:external.mappinglines.template,evaluation_type:0
-msgid "Direct Mapping"
-msgstr "Direct Mapping"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "Core Components"
-msgstr "Composants du coeur"
-
-#. module: base_external_referentials
-#: sql_constraint:external.mapping.line:0
-msgid "A referential can not have various mapping line imported from the same template mapping line"
-msgstr "Un référentiel ne peut pas avoir de différentes lignes de mapping importées depuis le même template de ligne de mapping"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "6- Export mapping lines"
-msgstr "6- Export des lignes de mapping"
-
-#. module: base_external_referentials
-#: view:external.mapping:0
-#: view:external.mapping.line:0
-#: view:external.referential:0
-#: view:external.referential.type:0
-#: view:external.report:0
-#: view:external.report.history:0
-#: view:external.report.line:0
-#: view:group.fields:0
-msgid "Group by..."
-msgstr "Regrouper par..."
-
-#. module: base_external_referentials
-#: field:external.mapping,external_resource_name:0
-#: field:external.mapping.template,external_resource_name:0
-msgid "External Resource Name"
-msgstr "Nom de la resource externe"
-
-#. module: base_external_referentials
-#: sql_constraint:external.mapping:0
-msgid "A referential can not have various mapping imported from the same template"
-msgstr "Un référentiel ne peut pas avoir de différents mapping importés depuis le même template"
-
-#. module: base_external_referentials
-#: field:external.report.history,start_date:0
-msgid "Start Date"
-msgstr "Date de départ"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:1083
-#, python-format
-msgid "only method export onebyone is implemented in base_external_referentials"
-msgstr "Seule la méthode d'export un par un est implémenté dans base_external_referentials"
-
-#. module: base_external_referentials
-#: model:ir.actions.act_window,name:base_external_referentials.act_window_external_referential
-#: model:ir.ui.menu,name:base_external_referentials.ir_ui_menu_external_referentials
-#: model:ir.ui.menu,name:base_external_referentials.menu_external_referential
-msgid "External Referentials"
-msgstr "Référentiels externes"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:1699
-#, python-format
-msgid "Error with mapping : %s. Sub mapping can be only apply on one2many, many2one or many2many fields"
-msgstr "Erreur avec le mapping : %s. Un sous-mapping ne peut être appliqué seulement sur des champs : one2many, many2one ou many2many"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,type:0
-#: selection:external.mappinglines.template,type:0
-msgid "External <-> OpenERP"
-msgstr "Externe <-> OpenERP"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-#: field:external.referential.type,categ_id:0
-msgid "Category"
-msgstr "Catégorie"
-
-#. module: base_external_referentials
-#: field:external.referential,mapping_ids:0
-msgid "Mappings"
-msgstr "Mappings"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,external_type:0
-#: selection:external.mappinglines.template,external_type:0
-msgid "URL"
-msgstr "URL"
-
-#. module: base_external_referentials
-#: view:external.mapping:0
-#: view:external.referential:0
-msgid "Object Mappings"
-msgstr "Object du mapping"
-
-#. module: base_external_referentials
-#: model:ir.model,name:base_external_referentials.model_ir_model_data
-msgid "ir.model.data"
-msgstr "ir.model.data"
-
-#. module: base_external_referentials
-#: field:external.mapping,external_search_method:0
-#: field:external.mapping.template,external_search_method:0
-msgid "Search Method"
-msgstr "Méthode de recherche"
-
-#. module: base_external_referentials
-#: model:ir.actions.act_window,name:base_external_referentials.ext_res_partner
-msgid "External Partner"
-msgstr "Partenaire externe"
-
-#. module: base_external_referentials
-#: view:external.report.history:0
-#: view:external.report.line:0
-#: model:ir.actions.act_window,name:base_external_referentials.ir_actions_act_window_external_report_history
-#: model:ir.model,name:base_external_referentials.model_external_report_history
-#: model:ir.ui.menu,name:base_external_referentials.ir_ui_menu_external_report_history
-msgid "External Report History"
-msgstr "Historique des rapports externes"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,datetime_format:0
-#: field:external.mappinglines.template,datetime_format:0
-msgid "Datetime Format"
-msgstr "Datetime Format"
-
-#. module: base_external_referentials
-#: model:ir.actions.act_window,name:base_external_referentials.ext_product_product
-msgid "External Product"
-msgstr "Produit externe"
-
-#. module: base_external_referentials
-#: field:external.report.line,state:0
-msgid "Status"
-msgstr "Status"
-
-#. module: base_external_referentials
-#: sql_constraint:ir.model:0
-msgid "Each model must be unique!"
-msgstr "Chaque modèle doit être unique!"
-
-#. module: base_external_referentials
-#: field:external.mapping.template,version_id:0
-#: field:external.mappinglines.template,version_id:0
-msgid "External Referential Version"
-msgstr "Version du référentiel externe"
-
-#. module: base_external_referentials
-#: sql_constraint:external.referential:0
-msgid "Referential names must be unique !"
-msgstr "Les noms des référentiels doivent être unique !"
-
-#. module: base_external_referentials
-#: field:external.mapping,external_list_method:0
-#: field:external.mapping.template,external_list_method:0
-msgid "List Method"
-msgstr "Méthode de listage"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:57
-#: code:addons/base_external_referentials/external_osv.py:88
-#: code:addons/base_external_referentials/external_osv.py:93
-#: code:addons/base_external_referentials/external_osv.py:1083
-#, python-format
-msgid "Developper Error"
-msgstr "Erreur développeur"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "1 - Reload Referential Mapping Templates"
-msgstr "1 - Recharger les templates de mapping externe"
-
-#. module: base_external_referentials
-#: field:external.referential,apiusername:0
-msgid "User Name"
-msgstr "Nom d'utilisateur"
-
-#. module: base_external_referentials
-#: help:external.mapping,related_model_ids:0
-msgid "potentially inherited through '_inherits' model, used for mapping field selection"
-msgstr "potentielement héritable grâce au modèle '_inherits', utilisé pour la séléction des champs de mapping"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "1- Export category"
-msgstr "1- Export de la catégorie"
-
-#. module: base_external_referentials
-#: model:res.groups,name:base_external_referentials.group_export_mapping
-msgid "Export Mapping Manager"
-msgstr "Responsable des mappings d'export"
-
-#. module: base_external_referentials
-#: view:external.report.history:0
-#: view:external.report.line:0
-#: field:external.report.line,date:0
-msgid "Date"
-msgstr "Date"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,external_type:0
-#: selection:external.mappinglines.template,external_type:0
-msgid "Integer"
-msgstr "Integer"
-
-#. module: base_external_referentials
-#: field:external.report,sync_from_object_id:0
-msgid "Sync From Object ID"
-msgstr "Synchro depuis l'ID d'objet"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:555
-#, python-format
-msgid "The field referential_id doesn't exist on the object %s. Reporting system can not be used"
-msgstr "Le champ référential_id n'existe pas sur l'object %s. Le système de rapports d'erreurs ne peut pas être utilisé"
-
-#. module: base_external_referentials
-#: field:external.referential,type_name:0
-msgid "External Type Name"
-msgstr "Nom du type  de référentiel externe"
-
-#. module: base_external_referentials
-#: field:external.report.history,user_id:0
-msgid "User"
-msgstr "Utilisateur"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,external_field:0
-#: field:external.mappinglines.template,external_field:0
-msgid "External Field"
-msgstr "Champ externe"
-
-#. module: base_external_referentials
-#: view:external.report.history:0
-#: view:external.report.line:0
-#: selection:external.report.line,state:0
-msgid "Success"
-msgstr "Succès"
-
-#. module: base_external_referentials
-#: field:external.report,email_tmpl_id:0
-msgid "Email Template"
-msgstr "Email Template"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:58
-#, python-format
-msgid "You can extend the class %s with the method %s.\",\n"
-"                \"Indeed this method already exist use the decorator 'replace' instead"
-msgstr "Vous pouvez étendre la classe %s avec la méthode %s.\",\n"
-"                \"En effet, cette méthode éxiste déjà. Veuillez utiliser le décorateur 'replace' à la place"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:509
-#, python-format
-msgid "External Import Error"
-msgstr "Erreur d'import externe"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,alternative_key:0
-#: field:external.mappinglines.template,alternative_key:0
-msgid "Alternative Key"
-msgstr "Alternative Key"
-
-#. module: base_external_referentials
-#: field:external.report,action:0
-#: view:external.report.line:0
-#: field:external.report.line,action:0
-msgid "Action"
-msgstr "Action"
-
-#. module: base_external_referentials
-#: field:external.report,line_ids:0
-msgid "Report Lines"
-msgstr "Lignes de rapports"
-
-#. module: base_external_referentials
-#: view:external.report:0
-msgid "Delete All Failed"
-msgstr "Supprimer tous les échecs"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "3- Export version"
-msgstr "3- Export de la version du référentiel"
-
-#. module: base_external_referentials
-#: view:external.mapping.line:0
-#: field:external.mapping.line,out_function:0
-#: field:external.mappinglines.template,out_function:0
-msgid "Export from OpenERP Mapping Python Function"
-msgstr "Export from OpenERP Mapping Python Function"
-
-#. module: base_external_referentials
-#: view:external.mapping:0
-#: view:external.mapping.line:0
-#: field:external.mapping.line,mapping_id:0
-#: field:external.mappinglines.template,mapping_id:0
-#: model:ir.model,name:base_external_referentials.model_external_mapping
-msgid "External Mapping"
-msgstr "Mapping externe"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "2 - Synchronize Referential Settings"
-msgstr "2 - Synchroniser les paramètres du référentiel"
-
-#. module: base_external_referentials
-#: field:external.mapping,external_delete_method:0
-#: field:external.mapping.template,external_delete_method:0
-msgid "Delete Method"
-msgstr "Méthode de suppression"
-
-#. module: base_external_referentials
-#: field:external.report.history,report_id:0
-#: field:external.report.line,report_id:0
-#: model:ir.model,name:base_external_referentials.model_external_report
-#: model:ir.ui.menu,name:base_external_referentials.ir_ui_menu_external_report
-msgid "External Report"
-msgstr "Rapports externes"
-
-#. module: base_external_referentials
-#: model:ir.model,name:base_external_referentials.model_external_referential_version
-msgid "External Referential Version (Ex: v1.5.0.0 +, v1.3.2.4 +)"
-msgstr "Version du référentiel externe (Ex: v1.5.0.0 +, v1.3.2.4 +)"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,external_type:0
-#: selection:external.mappinglines.template,external_type:0
-msgid "Float"
-msgstr "Float"
-
-#. module: base_external_referentials
-#: field:external.report,action_on:0
-#: field:external.report.line,action_on:0
-msgid "Action On"
-msgstr "Action sur"
-
-#. module: base_external_referentials
-#: view:external.report.line:0
-#: field:external.report.line,kwargs_text:0
-msgid "Kwargs Data"
-msgstr "Kwargs Data"
-
-#. module: base_external_referentials
-#: view:external.report.line:0
-#: field:external.report.line,args_text:0
-msgid "Args Data"
-msgstr "Args Data"
-
-#. module: base_external_referentials
-#: model:ir.actions.act_window,name:base_external_referentials.ext_sale_shop
-msgid "External Shop"
-msgstr "Boutique externe"
-
-#. module: base_external_referentials
-#: model:ir.model,name:base_external_referentials.model_group_fields
-msgid "trigger last write date by group of field"
-msgstr "trigger last write date by group of field"
-
-#. module: base_external_referentials
-#: field:external.report.line,kwargs:0
-msgid "Kwargs"
-msgstr "Kwargs"
-
-#. module: base_external_referentials
-#: help:external.mapping,extra_name:0
-msgid "In case you need to make many mappings on the same object"
-msgstr "En cas de besoin de créer plusieurs mappings pour le même objet"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,evaluation_type:0
-#: selection:external.mappinglines.template,evaluation_type:0
-msgid "Function"
-msgstr "Fonction"
-
-#. module: base_external_referentials
-#: field:external.report.line,res_id:0
-msgid "Resource Id"
-msgstr "Resource Id"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/decorator.py:64
-#, python-format
-msgid "Not parent method found"
-msgstr "Aucune méthode parent n'a été trouvée"
-
-#. module: base_external_referentials
-#: help:external.referential,create_date:0
-msgid "Date on which external referential is created."
-msgstr "Date de création du référentiel externe."
-
-#. module: base_external_referentials
-#: field:external.mapping.line,internal_field:0
-msgid "Field name"
-msgstr "Nom du champ"
-
-#. module: base_external_referentials
-#: view:external.mapping:0
-#: view:external.referential:0
-msgid "Add all object fields"
-msgstr "Ajouter tous les champs de l'objet"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,internal_type:0
-msgid "Internal Type"
-msgstr "Type interne"
-
-#. module: base_external_referentials
-#: help:external.mapping.line,alternative_key:0
-#: help:external.mappinglines.template,alternative_key:0
-msgid "Only one field can be selected as alternative key,if no external id was found for the record the alternative keywill be used to identify the resource"
-msgstr "Seulement un champ peut être séléctionner en tant qu'alternative key, Si aucune id externe n'est trouvée pour l'enregistrement, l'alternative key sera utilisée pour identifier la resource"
-
-#. module: base_external_referentials
-#: field:external.referential,apipass:0
-msgid "Password"
-msgstr "Mot de passe"
-
-#. module: base_external_referentials
-#: view:external.mapping:0
-#: view:external.referential:0
-msgid "Export mapping file"
-msgstr "Export des fichers de mapping"
-
-#. module: base_external_referentials
-#: field:external.referential.category,type_ids:0
-msgid "Types"
-msgstr "Types"
-
-#. module: base_external_referentials
-#: field:external.report,sync_from_object_model:0
-msgid "Sync From Object"
-msgstr "Synchro depuis l'objet"
-
-#. module: base_external_referentials
-#: model:ir.actions.act_window,name:base_external_referentials.ext_res_partner_address
-msgid "External Address"
-msgstr "Adresse externe"
-
-#. module: base_external_referentials
-#: code:addons/base_external_referentials/external_osv.py:89
-#, python-format
-msgid "You can replace the method %s of the class %s. Indeed this method doesn't exist"
-msgstr "vous pouvez remplacer la méthode %s de la classe %s. En effet, cette méthode n'existe pas"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,function_name:0
-#: field:external.mappinglines.template,function_name:0
-msgid "Function Name"
-msgstr "Function Name"
-
-#. module: base_external_referentials
-#: field:external.report.history,count_success:0
-msgid "Count Success"
-msgstr "Somme des succès"
-
-#. module: base_external_referentials
-#: model:ir.actions.act_window,name:base_external_referentials.ir_actions_act_window_external_mapping
-#: model:ir.ui.menu,name:base_external_referentials.ir_ui_menu_external_mappings
-msgid "External Mappings"
-msgstr "Mappings externes"
-
-#. module: base_external_referentials
-#: field:external.report.history,count_failed:0
-msgid "Count Failed"
-msgstr "Somme des échecs"
-
-#. module: base_external_referentials
-#: field:group.fields,field_ids:0
-#: model:ir.model,name:base_external_referentials.model_ir_model_fields
-msgid "Fields"
-msgstr "Champs"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,external_type:0
-#: selection:external.mappinglines.template,external_type:0
-msgid "List"
-msgstr "List"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,external_type:0
-#: field:external.mappinglines.template,external_type:0
-#: field:external.referential,type_id:0
-msgid "External Type"
-msgstr "Type externe"
-
-#. module: base_external_referentials
-#: help:external.mapping.line,child_mapping_id:0
-#: help:external.mappinglines.template,child_mapping_id:0
-msgid "This give you the possibility to import data with a structure of Parent/childFor example when you import a sale order, the sale order is the parent of the sale order lineIn this case you have to select the child mapping in order to convert the data"
-msgstr "Ceci vous donne la possibilité d'importer des données avec une structure de parents/enfants. Par exemple, lors de l'import d'une commande de vente, la commande est le parent des lignes de commandes de vente. Dans ce cas, veuillez sélectionner le mapping enfant afin de convertir les données."
-
-#. module: base_external_referentials
-#: view:group.fields:0
-#: field:group.fields,model_id:0
-msgid "Model"
-msgstr "Modèle"
-
-#. module: base_external_referentials
-#: field:external.mapping,external_update_method:0
-#: field:external.mapping.template,external_update_method:0
-msgid "Update Method"
-msgstr "Méthode de mise à jour"
-
-#. module: base_external_referentials
-#: view:external.report.line:0
-msgid "External Report Line"
-msgstr "Ligne de rapport externe"
-
-#. module: base_external_referentials
-#: field:external.mapping,model_id:0
-#: field:external.mapping.template,model_id:0
-msgid "OpenERP Model"
-msgstr "Modèle OpenERP"
-
-#. module: base_external_referentials
-#: sql_constraint:ir.model.data:0
-msgid "You cannot have on record with multiple external id for a same referential"
-msgstr "Vous ne pouvez pas avoir un enregistrement avec plusieurs id externe pour un même référentiel"
-
-#. module: base_external_referentials
-#: field:external.report.line,exception_type:0
-msgid "Exception Type"
-msgstr "Type d'exception"
-
-#. module: base_external_referentials
-#: field:external.report.line,external_id:0
-msgid "External ID"
-msgstr "ID externe"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "5- Export mapping template"
-msgstr "5- Export des template de mapping"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,template_id:0
-msgid "External Mapping Lines Template"
-msgstr "Template de lignes de mapping externe"
-
-#. module: base_external_referentials
-#: help:external.referential,debug:0
-msgid "If debug mode is active all request between the external referential and OpenERP will be in the log"
-msgstr "Si le mode debug est activé, toutes les requètes entre le référentiel externe et OpenERP apparaitront dans les logs"
-
-#. module: base_external_referentials
-#: selection:external.mapping.line,external_type:0
-#: selection:external.mappinglines.template,external_type:0
-msgid "Boolean"
-msgstr "Boolean"
-
-#. module: base_external_referentials
-#: field:group.fields,column_name:0
-msgid "Column Name"
-msgstr "Nom de la colonne"
-
-#. module: base_external_referentials
-#: field:external.mapping.line,evaluation_type:0
-#: field:external.mappinglines.template,evaluation_type:0
-msgid "Evalution Type"
-msgstr "Type pour l'évaluation"
-
-#. module: base_external_referentials
-#: view:external.referential:0
-msgid "4- Export referential"
-msgstr "4- Export du référentiel"
-
-#. module: base_external_referentials
-#: view:external.mapping.line:0
-msgid "External fields"
-msgstr "Champs externes"
-
-#. module: base_external_referentials
-#: view:external.report.line:0
-#: model:ir.actions.act_window,name:base_external_referentials.ir_actions_act_window_external_report_line
-#: model:ir.model,name:base_external_referentials.model_external_report_line
-#: model:ir.ui.menu,name:base_external_referentials.ir_ui_menu_external_report_line
-msgid "External Report Lines"
-msgstr "Lignes des rapports externes"
-

=== modified file 'base_external_referentials/message_error.py'
--- base_external_referentials/message_error.py	2012-09-21 16:06:27 +0000
+++ base_external_referentials/message_error.py	2013-09-02 20:41:47 +0000
@@ -26,7 +26,7 @@
         self.mapping_name = mapping_name
         self.mapping_object = mapping_object
     def __str__(self):
-        return 'the mapping line: %s for the object %s has this error: %s' % (self.mapping_name,
+        return 'the mapping line: %s for the object %s have an error: %s' % (self.mapping_name,
                                                                              self.mapping_object,
                                                                              self.value)
 

=== modified file 'base_external_referentials/report.py'
--- base_external_referentials/report.py	2012-11-01 15:51:18 +0000
+++ base_external_referentials/report.py	2013-09-02 20:41:47 +0000
@@ -28,12 +28,6 @@
 from base_external_referentials.external_osv import ExternalSession
 from base_external_referentials.decorator import commit_now
 
-MODEL_WITH_UNIQUE_REPORT_LINE = [
-    'product.product',
-    'product.category',
-    ]
-
-
 class external_report(Model):
     _name = 'external.report'
     _description = 'External Report'
@@ -53,7 +47,7 @@
 
     _columns = {
         'name': fields.function(_get_full_name, store=True, type='char', size=256, string='Name'),
-        'action': fields.char('Action', size=256, required=True, readonly=True),
+        'action': fields.char('Action', size=32, required=True, readonly=True),
         'action_on': fields.many2one('ir.model', 'Action On',required=True, readonly=True),
         'sync_from_object_model': fields.many2one('ir.model', 'Sync From Object',
                                                         required=True, readonly=True),
@@ -64,7 +58,6 @@
         'failed_line_ids': fields.one2many('external.report.line', 'report_id',
                                         'Failed Report Lines', domain=[('state', '!=', 'success')]),
         'history_ids': fields.one2many('external.report.history','report_id', 'History'),
-        'email_tmpl_id': fields.many2one('email.template', 'Email Template', help="Email template used to send an email every time a failed report line is created"),
     }
 
     def _get_report(self, cr, uid, action, action_on, sync_from_object, context=None):
@@ -239,7 +232,7 @@
         'state': fields.selection((('success', 'Success'),
                                    ('fail', 'Failed')),
                                    'Status', required=True, readonly=True),
-        'action': fields.char('Action', size=256, required=True, readonly=True),
+        'action': fields.char('Action', size=32, required=True, readonly=True),
         'action_on': fields.many2one('ir.model', 'Action On',required=True, readonly=True),
         'res_id': fields.integer('Resource Id', readonly=True),
         'date': fields.datetime('Date', required=True, readonly=True),
@@ -259,18 +252,6 @@
         "date": lambda *a: time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
     }
 
-    def get_existing_line_id(self, cr, uid, action_on, action, res_id=None, external_id=None, context=None):
-        if context.get('retry_report_line_id'):
-            return context['retry_report_line_id']
-        elif action_on in MODEL_WITH_UNIQUE_REPORT_LINE:
-            existing_line_id = self.search(cr, uid, [
-                              ('action_on', '=', action_on),
-                              ('action', '=', action),
-                              ('res_id', '=', res_id),
-                              ('external_id', '=', external_id),
-                        ], context=context)
-            return existing_line_id and existing_line_id[0] or False
-        return False
 
     #TODO
     #1 - Did it usefull to log sucessfull entry?
@@ -280,8 +261,7 @@
     def start_log(self, cr, uid, action_on, action, res_id=None,
                   external_id=None, resource=None, args=None, kwargs=None):
         context = kwargs.get('context') or {}
-        existing_line_id = self.get_existing_line_id(cr, uid,action_on, action,
-                                          res_id=res_id, external_id=external_id, context=context)
+        existing_line_id = context.get('retry_report_line_id', False)
         report_id = context.get('report_id')
 
         if existing_line_id:
@@ -310,15 +290,10 @@
                         })
         return existing_line_id
 
+    @commit_now
     def log_fail(self, cr, uid, external_session, report_line_id, error_message, context=None):
-        self._log_fail(cr, uid, external_session, report_line_id, error_message, context=context)
-        if not context.get('no_mail'):
-            self._send_mail(cr, uid, report_line_id, context=context)
-        return True
-
-    @commit_now
-    def _log_fail(self, cr, uid, external_session, report_line_id, error_message, context=None):
         exc_type, exc_value, exc_traceback = sys.exc_info()
+
         if external_session:
             external_session.logger.exception(error_message)
         self.write(cr, uid, report_line_id, {
@@ -334,14 +309,6 @@
         return True
 
     @commit_now
-    def _send_mail(self, cr, uid, report_line_id, context=None):
-        line = self.browse(cr, uid, report_line_id, context=context)
-        if line.report_id.email_tmpl_id:
-            self.pool.get('email.template').send_mail(cr, uid, line.report_id.email_tmpl_id.id,\
-                                                  report_line_id, force_send=True, context=context)
-        return True
-    
-    @commit_now
     def log_success(self, cr, uid, external_session, report_line_id, context=None):
         self.write(cr, uid, report_line_id, {'state': 'success'}, context=context)
         if external_session and external_session.tmp.get('history_id'):
@@ -365,8 +332,6 @@
                 if not kwargs.get('context', False):
                     kwargs['context']={}
 
-                #don't send email when retry
-                kwargs['context']['no_mail'] = True
                 # keep the id of the line to update it with the result
                 kwargs['context']['retry_report_line_id'] = log.id
 
@@ -374,8 +339,6 @@
             else:
                 if not kwargs.get('context', False):
                     kwargs['context']={}
-                #don't send email when retry
-                kwargs['context']['no_mail'] = True
                 kwargs['context']['retry_report_line_id'] = log.id
                 method(cr, uid, *args, **kwargs)
         return True

=== removed file 'base_external_referentials/report_mail_template.xml'
--- base_external_referentials/report_mail_template.xml	2013-01-15 10:00:05 +0000
+++ base_external_referentials/report_mail_template.xml	1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  base_external_referentials for OpenERP
-  Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@xxxxxxxxxxxx>
-  The licence is in the file __openerp__.py
--->
-<openerp>
-    <data noupdate="1">
-
-        <!--Email template -->
-        <record id="email_template_report" model="email.template">
-            <field name="name">Reporting error</field>
-            <field name="email_from">Select email from</field>
-            <field name="subject">Error with ${object.report_id.name or '' })</field>
-            <field name="email_to">Select receiver</field>
-            <field name="model_id" ref="base_external_referentials.model_external_report_line"/>
-            <field name="auto_delete" eval="True"/>
-            <field name="lang">Select language</field>
-            <field name="body_html"><![CDATA[]]></field>
-            <field name="body_text"><![CDATA[
-An error occurred during the import of the ${object.report_id.action_on}
-
-The message is : ${object.error_message}]]></field>
-        </record>
-    </data>
-</openerp>
-

=== modified file 'base_external_referentials/report_view.xml'
--- base_external_referentials/report_view.xml	2012-11-01 15:51:18 +0000
+++ base_external_referentials/report_view.xml	2013-09-02 20:41:47 +0000
@@ -16,7 +16,6 @@
           <field name="sync_from_object_model"/>
           <field name="sync_from_object_id"/>
           <field name="referential_id"/>
-          <field name="email_tmpl_id"/>
           <newline/>
           <field name="failed_line_ids" nolabel="1" colspan="4"/>
           <button name="retry_failed_lines" string="Retry All Failed" icon="gtk-go-forward" type="object" colspan="2"/>

=== modified file 'base_file_protocole/__openerp__.py'
--- base_file_protocole/__openerp__.py	2012-12-26 09:58:46 +0000
+++ base_file_protocole/__openerp__.py	2013-09-02 20:41:47 +0000
@@ -21,7 +21,7 @@
 
 {
     'name': 'base_file_protocole',
-    'version': '6.1.0',
+    'version': '0.1',
     'category': 'Generic Modules/Others',
     'license': 'AGPL-3',
     'description': """empty""",
@@ -32,7 +32,7 @@
     'update_xml': [
     ],
     'demo_xml': [],
-    'installable': False,
+    'installable': True,
     'active': False,
 }
 

=== modified file 'base_file_protocole/base_file_protocole.py'
--- base_file_protocole/base_file_protocole.py	2012-12-21 17:16:07 +0000
+++ base_file_protocole/base_file_protocole.py	2013-09-02 20:41:47 +0000
@@ -20,19 +20,12 @@
 ###############################################################################
 
 from tempfile import TemporaryFile
-import ftplib
+from ftplib import FTP
 import os
 import csv
 import paramiko
 import errno
 import functools
-import logging
-
-_logger = logging.getLogger(__name__)
-try:
-    import xlrd
-except ImportError:
-    _logger.warning('You must install xlrd, if you need to read xls file')
 
 def open_and_close_connection(func):
     """
@@ -42,23 +35,18 @@
     """
     @functools.wraps(func)
     def wrapper(self, *args, **kwargs):
-        if self.persistant:
-            if not self.connection:
-                self.connect()
-            return func(self, *args, **kwargs)
-        else:
-            self.connect()
-            try:
-                response = func(self, *args, **kwargs)
-            except:
-                raise
-            finally:
-                self.close()
-            return response
+        self.connect()
+        try:
+            response = func(self, *args, **kwargs)
+        except:
+            raise
+        finally:
+            self.close()
+        return response
     return wrapper
 
 # Extend paramiko lib with the method mkdirs
-def stfp_mkdirs(self, path, mode=511):
+def mkdirs(self, path, mode=511):
     try:
         self.stat(path)
     except IOError, e:
@@ -71,25 +59,7 @@
                     self.mkdir(path, mode)
                 else:
                     raise
-paramiko.SFTPClient.mkdirs = stfp_mkdirs
-
-# Extend ftplib with the method mkdirs
-def ftp_mkdirs(self, path):
-    current_dir = self.pwd()
-    try:
-        self.cwd(path)
-    except ftplib.error_perm, e:
-        if "550" in str(e):
-            try:
-                self.mkd(path)
-            except ftplib.error_perm, e:
-                if "550" in str(e):
-                    self.mkdirs(os.path.dirname(path))
-                    self.mkd(path)
-                else:
-                    raise
-    self.cwd(current_dir)
-ftplib.FTP.mkdirs = ftp_mkdirs
+paramiko.SFTPClient.mkdirs = mkdirs
 
 
 class FileConnection(object):
@@ -97,20 +67,20 @@
     def is_(self, protocole):
         return self.protocole.lower() == protocole
 
-    def __init__(self, protocole, location, user, pwd, port=None, allow_dir_creation=None, home_folder='/', persistant=False):
+    def __init__(self, protocole, location, user, pwd, port=None, allow_dir_creation=None, home_folder='/'):
         self.protocole = protocole
         self.allow_dir_creation = allow_dir_creation
         self.location = location
-        self.home_folder = home_folder or '/'
+        self.home_folder = home_folder
         self.port = port
         self.user = user
         self.pwd = pwd
         self.connection = None
-        self.persistant = False
+
 
     def connect(self):
         if self.is_('ftp'):
-            self.connection = ftplib.FTP(self.location)
+            self.connection = FTP(self.location)
             self.connection.login(self.user, self.pwd)
         elif self.is_('sftp'):
             transport = paramiko.Transport((self.location, self.port or 22))
@@ -124,9 +94,6 @@
     @open_and_close_connection
     def send(self, filepath, filename, output_file, create_patch=None):
         if self.is_('ftp'):
-            filepath = os.path.join(self.home_folder, filepath)
-            if self.allow_dir_creation:
-                self.connection.mkdirs(filepath)
             self.connection.cwd(filepath)
             self.connection.storbinary('STOR ' + filename, output_file)
             output_file.close()
@@ -266,27 +233,3 @@
     def writerows(self, rows):
         for row in rows:
             self.writerow(row)
-
-
-class FileXlsReader(object):
-
-    def __init__(self, file_contents):
-        self.file_contents = file_contents
-
-    def read(self):
-        wb = xlrd.open_workbook(file_contents=self.file_contents)
-        sheet_name = wb.sheet_names()[0]
-        sh = wb.sheet_by_name(sheet_name)
-        header = sh.row_values(0)
-        result = []
-        for rownum in range(1, sh.nrows):
-            row = {}
-            index = 0
-            for val in sh.row_values(rownum):
-                row[header[index]] = val
-                index += 1
-            result.append(row)
-        return result
-
-
-

=== modified file 'base_onchange_player/__init__.py'
--- base_onchange_player/__init__.py	2012-10-26 07:41:18 +0000
+++ base_onchange_player/__init__.py	2013-09-02 20:41:47 +0000
@@ -2,8 +2,7 @@
 #################################################################################
 #                                                                               #
 #    base_onchange_player for OpenERP                                           #
-#    Copyright (C) 2011 Akretion http://www.akretion.com/                       #
-#    @author Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>                       #
+#    Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>   #
 #                                                                               #
 #    This program is free software: you can redistribute it and/or modify       #
 #    it under the terms of the GNU Affero General Public License as             #
@@ -23,3 +22,6 @@
 
 import onchange_osv
 
+
+
+

=== modified file 'base_onchange_player/__openerp__.py'
--- base_onchange_player/__openerp__.py	2012-12-26 09:58:46 +0000
+++ base_onchange_player/__openerp__.py	2013-09-02 20:41:47 +0000
@@ -2,8 +2,7 @@
 #################################################################################
 #                                                                               #
 #    base_onchange_player for OpenERP                                           #
-#    Copyright (C) 2011 Akretion http://www.akretion.com/                       #
-#    @author Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>                       #
+#    Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>   #
 #                                                                               #
 #    This program is free software: you can redistribute it and/or modify       #
 #    it under the terms of the GNU Affero General Public License as             #
@@ -23,20 +22,20 @@
 
 {
     'name': 'base_onchange_player',
-    'version': '6.1.0',
+    'version': '0.1',
     'category': 'ORM Extention',
     'license': 'AGPL-3',
-    'description': """This module gives the possibility to call onchange methods easily in your code. This module just adds some abstraction when you need to call onchange methods.
-
-To get an example of how you should use this code, look at the module base_sale_multichannels.
+    'description': """This module give the possibility to call onchange method easily in your code, it's just an Abstract Module that add some abstraction when you need to call onchange method.
+        A sample of call is done in the module base_sale_multichannels
         """,
     'author': 'Akretion',
     'website': 'http://www.akretion.com/',
     'depends': ['base'],
     'init_xml': [],
-    'update_xml': [],
+    'update_xml': [
+    ],
     'demo_xml': [],
-    'installable': False,
+    'installable': True,
     'active': False,
 }
 

=== modified file 'base_onchange_player/onchange_osv.py'
--- base_onchange_player/onchange_osv.py	2012-10-26 09:13:11 +0000
+++ base_onchange_player/onchange_osv.py	2013-09-02 20:41:47 +0000
@@ -2,8 +2,7 @@
 ################################################################################
 #                                                                              #
 #    base_onchange_player for OpenERP                                          #
-#    Copyright (C) 2011 Akretion http://www.akretion.com/                      #
-#    @author Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>                      #
+#    Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>  #
 #                                                                              #
 #    This program is free software: you can redistribute it and/or modify      #
 #    it under the terms of the GNU Affero General Public License as            #
@@ -27,39 +26,39 @@
 
 def call_onchange(self, cr, uid, onchange_name, vals, defaults=None, **kwargs):
     """
-    Used in base_sale_multichannel in order to call onchange method on sale_order_line and sale_order.
-    In order to call onchange, you must have to create a function "_get_kwargs_my_onchange_name"
-    that will return the kwargs for your onchange.
+    Used in base_sale_multichannel in order to call onchange method on sale_order_line and sale_order
+    In order to call onchange you must have to create a function "_get_kwargs_my_onchange_name"
+    that will return the kwargs for your onchange
 
-    @param onchange_name: string that contains the onchange method to call
-    @param vals: dictionnary of values that has been filled for the object
+    @param onchange_name: string that contain the onchange method to call
+    @param vals: dictionnary of value that have been filled for the object
     @param defaults: dictionnary of defaults values for the object
-    @return: dictionary of lines updated with the values returned by the onchange
+    @return: dictionary of line updated with the value returned by the onchange
     """
-    if defaults is None:
-        defaults = {}
+    if not defaults:
+        defaults={}
     vals_with_default = defaults.copy()
     vals_with_default.update(vals)
     try :
-        args2, kwargs2 = getattr(self, "_get_params_%s" % onchange_name)(cr, uid, vals_with_default, **kwargs)
+        kwargs2 = eval("self._get_kwargs_%s"%onchange_name)(cr, uid, vals_with_default, **kwargs)
     except Exception, e:
         if config['debug_mode']: raise
         raise except_osv(_('On Change Player'),
-                         _("Error when trying to get the params for the onchange %s on "
+                         _("Error when trying to get the kwargs for the onchange %s on "
                            "the object %s. Error message : %s") % (onchange_name, self._name, e))
     try :
-        res = getattr(self, onchange_name)(cr, uid, *args2, **kwargs2)
+        res = eval("self.%s"%onchange_name)(cr, uid, **kwargs2)
         for key in res['value']:
             if not key in vals:
-                # If the value is false and the field is not a boolean, we don't pass it as it is useless
-                # If it's a problem for you, please contact me sebastien.beau@xxxxxxxxxxxx,
-                # because passing empty value will trigger a conflict with magentoerpconnect. Thanks.
+                # If the value is false and the field is not a boolean we don't pass it as it useless
+                # If it's a problem for you please contact me sebastien.beau@xxxxxxxxxxxx, 
+                # because pass empty value will provoque some conflict with magentoerpconnect. Thanks
                 if res['value'][key] or self._columns[key]._type == 'bool':
                     vals[key] = res['value'][key]
     except Exception, e:
         if config['debug_mode']: raise
         raise except_osv(_('On Change Player'),
-                         _("Error when trying to play the onchange %s on the object %s. "
+                         _("Error when trying to playing the onchange %s on the object %s. "
                            "Error message : %s") % (onchange_name, self._name, e))
     return vals
 

=== modified file 'base_pop_up/__openerp__.py'
--- base_pop_up/__openerp__.py	2012-12-26 09:58:46 +0000
+++ base_pop_up/__openerp__.py	2013-09-02 20:41:47 +0000
@@ -22,7 +22,7 @@
 
 {
     'name': 'base_pop_up',
-    'version': '6.1.0',
+    'version': '0.1',
     'category': 'Generic Modules/Others',
     'license': 'AGPL-3',
     'description': """empty""",
@@ -34,7 +34,7 @@
            'pop_up_file_view.xml',
     ],
     'demo_xml': [],
-    'installable': False,
+    'installable': True,
     'active': False,
 }
 

=== modified file 'base_scheduler_creator/__openerp__.py'
--- base_scheduler_creator/__openerp__.py	2012-12-26 09:58:46 +0000
+++ base_scheduler_creator/__openerp__.py	2013-09-02 20:41:47 +0000
@@ -21,7 +21,7 @@
 
 {
     "name" : "base_scheduler_creator",
-    "version" : "6.1.0",
+    "version" : "1.0",
     "license": "AGPL-3",
     "depends" : ["base"],
     "author" : "Akretion",
@@ -32,5 +32,5 @@
     "demo_xml" : [],
     "update_xml" : ["schedulder_creator.xml"],
     "active": False,
-    "installable": False,
+    "installable": True,
 }

=== modified file 'file_exchange/__openerp__.py'
--- file_exchange/__openerp__.py	2012-12-26 09:58:46 +0000
+++ file_exchange/__openerp__.py	2013-09-02 20:41:47 +0000
@@ -21,7 +21,7 @@
 
 {
     'name': 'file_exchange',
-    'version': '6.1.0',
+    'version': '0.1',
     'category': 'Generic Modules/Others',
     'license': 'AGPL-3',
     'description': """
@@ -36,13 +36,12 @@
         'file_exchange_view.xml',
         'file_exchange_menu.xml',
         'settings/external.referential.category.csv',
-        'settings/external.referential.type.csv',
         'security/file_exchange_security.xml',
         'security/file_exchange_security.xml',
         'security/ir.model.access.csv',
     ],
     'demo_xml': [],
-    'installable': False,
+    'installable': True,
     'active': False,
 }
 

=== modified file 'file_exchange/file_exchange.py'
--- file_exchange/file_exchange.py	2012-12-03 16:26:23 +0000
+++ file_exchange/file_exchange.py	2013-09-02 20:41:47 +0000
@@ -24,12 +24,11 @@
 from openerp.osv import fields
 from openerp.osv.osv import except_osv
 from base_external_referentials.external_osv import ExternalSession
-from base_file_protocole.base_file_protocole import FileCsvReader, FileCsvWriter, FileXlsReader
+from base_file_protocole.base_file_protocole import FileCsvReader, FileCsvWriter
 from base_external_referentials.decorator import open_report
 from tempfile import TemporaryFile
 from encodings.aliases import aliases
 from tools.translate import _
-from openerp.tools.config import config
 
 
 #TODO implement the FileCsvWriter in base_file_protocole and remove import csv
@@ -48,7 +47,7 @@
             try:
                 exec self.pre_processing in space
             except Exception, e:
-                raise except_osv(_('Error!'), _('Error can not apply the python action pre-processing value'))
+                raise except_osv(_('Error !'), _('Error can not apply the python action pre-processing value'))
         return row
 
 class file_exchange(Model):
@@ -71,7 +70,7 @@
                 try:
                     exec field.advanced_default_value in space
                 except Exception, e:
-                    raise except_osv(_('Error!'),
+                    raise except_osv(_('Error !'),
                                      _('Error when evaluating advanced default value: %s \n Exception: %s') % (fields.name,e))
                 res[field.name] = space.get('result', False)
             elif field.default_value:
@@ -104,8 +103,6 @@
                                         encoding=method.encoding,
                                         pre_processing=method.pre_processing)
             res = csv.reorganize(field_structure=mapping_tree, merge_keys=merge_keys, ref_field=merge_key)
-        elif format in ['xls']:
-            res = FileXlsReader(external_file.read()).read()
         return res
 
     def _get_mapping_tree(self, cr, uid, mapping_id, parent_name=None, grand_parent_name=None, context=None):
@@ -238,7 +235,7 @@
     def _check_if_file_exist(self, cr, uid, external_session, folder_path, filename, context=None):
         exist = external_session.connection.search(folder_path, filename)
         if exist:
-            raise except_osv(_('Error!'), _('The file "%s" already exist in the folder "%s"' %(filename, folder_path)))
+            raise except_osv(_('Error !'), _('The file "%s" already exist in the folder "%s"' %(filename, folder_path)))
         return False
 
     def _export_files(self, cr, uid, method_id, context=None):
@@ -252,7 +249,7 @@
                         if 'hidden_field_to_split_' in key:
                             if isinstance(value, list):
                                 if row_to_flat:
-                                    raise except_osv(_('Error!'), _('Can not flat two row in the same resource'))
+                                    raise except_osv(_('Error !'), _('Can not flat two row in the same resource'))
                                 row_to_flat = value
                             elif isinstance(value, dict):
                                 for k,v in flat_resources([value])[0].items():
@@ -383,8 +380,7 @@
             try:
                 exec action_code in space
             except Exception, e:
-                if config['debug_mode']: raise
-                raise except_osv(_('Error!'),
+                raise except_osv(_('Error !'),
                                  _("Error can not apply the python action '%s'"
                                    " for the method: '%s' \n Exception: '%s'") % (action_name, method.name,e))
             if 'result' in space:
@@ -411,7 +407,7 @@
                                                                 "and to be imported in the ERP ; OUT for files to be"
                                                                 "generated from the ERP and send to the other system")),
         'mapping_id':fields.many2one('external.mapping', 'External Mapping', require="True", domain="[('referential_id', '=', referential_id)]"),
-        'format' : fields.selection([('csv','CSV'),('csv_no_header','CSV WITHOUT HEADER'), ('xls', 'XLS')], 'File format'),
+        'format' : fields.selection([('csv','CSV'),('csv_no_header','CSV WITHOUT HEADER')], 'File format'),
         'referential_id':fields.many2one('external.referential', 'Referential',help="Referential to use for connection and mapping", require=True),
         'scheduler':fields.many2one('ir.cron', 'Scheduler',help="Scheduler that will execute the cron task"),
         'search_filter':  fields.char('Search Filter', size=256),

=== removed file 'file_exchange/settings/external.referential.type.csv'
--- file_exchange/settings/external.referential.type.csv	2012-10-21 11:22:42 +0000
+++ file_exchange/settings/external.referential.type.csv	1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-id,name,categ_id:id,code
-ref_type_FTP-file-exchange,FTP,file-exchange,FTP
-ref_type_SFTP-file-exchange,SFTP,file-exchange,SFTP

=== removed directory 'framework_helpers'
=== removed file 'framework_helpers/__init__.py'
--- framework_helpers/__init__.py	2012-11-19 17:18:04 +0000
+++ framework_helpers/__init__.py	1970-01-01 00:00:00 +0000
@@ -1,22 +0,0 @@
-# -*- encoding: utf-8 -*-
-#################################################################################
-#                                                                               #
-#    framework_helpers for OpenERP                                              #
-#    Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@xxxxxxxxxxxx>   #
-#                                                                               #
-#    This program is free software: you can redistribute it and/or modify       #
-#    it under the terms of the GNU Affero General Public License as             #
-#    published by the Free Software Foundation, either version 3 of the         #
-#    License, or (at your option) any later version.                            #
-#                                                                               #
-#    This program is distributed in the hope that it will be useful,            #
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
-#    GNU Affero General Public License for more details.                        #
-#                                                                               #
-#    You should have received a copy of the GNU Affero General Public License   #
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      #
-#                                                                               #
-#################################################################################
-
-import context_managers

=== removed file 'framework_helpers/__openerp__.py'
--- framework_helpers/__openerp__.py	2012-12-26 13:39:06 +0000
+++ framework_helpers/__openerp__.py	1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
-# -*- encoding: utf-8 -*-
-#################################################################################
-#                                                                               #
-#    framework_helpers for OpenERP                                              #
-#    Copyright (C) 2012 Akretion Benoît Guillot <benoit.guillot@xxxxxxxxxxxx>   #
-#                                                                               #
-#    This program is free software: you can redistribute it and/or modify       #
-#    it under the terms of the GNU Affero General Public License as             #
-#    published by the Free Software Foundation, either version 3 of the         #
-#    License, or (at your option) any later version.                            #
-#                                                                               #
-#    This program is distributed in the hope that it will be useful,            #
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
-#    GNU Affero General Public License for more details.                        #
-#                                                                               #
-#    You should have received a copy of the GNU Affero General Public License   #
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      #
-#                                                                               #
-#################################################################################
-
-{
-    'name': 'framework_helpers',
-    'version': '0.1',
-    'category': 'Generic Modules/Others',
-    'license': 'AGPL-3',
-    'description': """This module provides methods for the framework.""",
-    'author': 'Akretion',
-    'website': 'http://www.akretion.com/',
-    'depends': ['base'], 
-    'init_xml': [],
-    'update_xml': [],
-    'demo_xml': [],
-    'installable': True,
-    'active': False,
-}
-

=== removed file 'framework_helpers/context_managers.py'
--- framework_helpers/context_managers.py	2012-11-19 17:18:04 +0000
+++ framework_helpers/context_managers.py	1970-01-01 00:00:00 +0000
@@ -1,66 +0,0 @@
-# -*- encoding: utf-8 -*-
-#################################################################################
-#                                                                               #
-#    framework_helpers for OpenERP                                              #
-#    Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@xxxxxxxxxxxx>   #
-#                                                                               #
-#    This program is free software: you can redistribute it and/or modify       #
-#    it under the terms of the GNU Affero General Public License as             #
-#    published by the Free Software Foundation, either version 3 of the         #
-#    License, or (at your option) any later version.                            #
-#                                                                               #
-#    This program is distributed in the hope that it will be useful,            #
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
-#    GNU Affero General Public License for more details.                        #
-#                                                                               #
-#    You should have received a copy of the GNU Affero General Public License   #
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      #
-#                                                                               #
-#################################################################################
-
-import pooler
-from contextlib import contextmanager
-
-@contextmanager
-def commit_now(cr, logger, raise_error=False):
-    """
-    Context Manager to use in order to commit into a cursor
-    correctly with a try/except method and a rollback if necessary
-    :param cr cursor: cursor to commit
-    :param logger logger: logger used to logging the message
-    :param raise_error boolean: Set to true only if you want
-             to stop the process if an error occured
-    """
-    try:
-        yield cr
-    except Exception, e:
-        cr.rollback()
-        logger.exception(e)
-        if raise_error:
-            raise
-    else:
-        cr.commit()
-
-@contextmanager
-def new_cursor(cr, logger, raise_error=False):
-    """
-    Context Manager to use in order to commit into a new cursor
-    correctly with a try/except method and a rollback if necessary
-    :param cr cursor: cursor to copy
-    :param logger logger: logger used to logging the message
-    :param raise_error boolean: Set to true only if you want
-             to stop the process if an error occured
-    """
-    new_cr = pooler.get_db(cr.dbname).cursor()
-    try:
-        yield new_cr
-    except Exception, e:
-        new_cr.rollback()
-        logger.exception(e)
-        if raise_error:
-            raise
-    else:
-        new_cr.commit()
-    finally:
-        new_cr.close()

=== removed directory 'import_odbc'
=== removed file 'import_odbc/__init__.py'
--- import_odbc/__init__.py	2012-08-06 03:31:18 +0000
+++ import_odbc/__init__.py	1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    Daniel Reis
-#    2011
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import import_odbc
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== removed file 'import_odbc/__openerp__.py'
--- import_odbc/__openerp__.py	2012-09-12 15:34:59 +0000
+++ import_odbc/__openerp__.py	1970-01-01 00:00:00 +0000
@@ -1,84 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    Daniel Reis
-#    2011
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-{
-    'name': 'Import data from SQL and ODBC data sources.',
-    'version': '61.3',
-    'category': 'Tools',
-    'description': """
-Import data directly from other databases.
-
-Installed in the Administration module, menu Configuration -> Import from SQL.
-
-Features:
- * Fetched data from the databases are used to build lines equivalent to regular import files. These are imported using the standard "import_data()" ORM method, benefiting from all its features, including xml_ids.
- * Each table import is defined by an SQL statement, used to build the equivalent for an import file. Each column's name should match the column names you would use in an import file. The first column must provide an unique identifier for the record, and will be used to build its xml_id.
- * SQL columns named "none" are ignored. This can be used for the first column of the SQL, so that it's used to build the XML Id but it's not imported to any OpenERP field.
- * The last sync date is the last successfull execution can be used in the SQL using "%(sync)s", or ":sync" in the case of Oracle.
- * When errors are found, only the record with the error fails import. The other correct records are commited. However, the "last sync date" will only be automaticaly updated when no errors are found.
- * The import execution can be scheduled to run automatically.
-
-Examples: 
- * Importing suppliers to res.partner:
-      SELECT distinct 
-            [SUPPLIER_CODE] as "ref"
-          , [SUPPLIER_NAME] as "name"
-          , 1 as "is_supplier"
-          , [INFO] as "comment"
-        FROM T_SUPPLIERS
-       WHERE INACTIVE_DATE IS NULL and DATE_CHANGED >= %(sync)s
-
- * Importing products to product.product:
-      SELECT PRODUCT_CODE as "ref"
-           , PRODUCT_NAME as "name"
-           , 'res_partner_id_'+SUPPLIER_ID as "partner_id/id"
-        FROM T_PRODUCTS 
-       WHERE DATE_CHANGED >= %(sync)s 
-
-Improvements ideas waiting for a contributor:
- * Allow to import many2one fields (currently not supported). Done by adding a second SQL sentence to get child record list?
- * Allow "import sets" that can be executed at different time intervals using different scheduler jobs.
- * Allow to inactivate/delete OpenERP records when not present in an SQL result set. 
-    """,
-    'author': 'Daniel Reis',
-    'website': 'http://launchpad.net/addons-tko',
-    'images': [
-        'images/snapshot1.png',
-        'images/snapshot2.png',
-    ],
-    'depends': [
-        'base',
-        'base_external_dbsource',
-    ],
-    'init': [],
-    'data': [
-        'import_odbc_view.xml',
-        'security/ir.model.access.csv',
-    ],
-    'demo': [
-        'import_odbc_demo.xml',
-    ],
-    'test': [], 
-    'installable': True,
-    'active': False,
-}
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== removed directory 'import_odbc/images'
=== removed file 'import_odbc/images/snapshot1.png'
Binary files import_odbc/images/snapshot1.png	2012-08-06 03:31:18 +0000 and import_odbc/images/snapshot1.png	1970-01-01 00:00:00 +0000 differ
=== removed file 'import_odbc/images/snapshot2.png'
Binary files import_odbc/images/snapshot2.png	2012-08-06 03:31:18 +0000 and import_odbc/images/snapshot2.png	1970-01-01 00:00:00 +0000 differ
=== removed file 'import_odbc/import_odbc.py'
--- import_odbc/import_odbc.py	2012-09-13 10:08:37 +0000
+++ import_odbc/import_odbc.py	1970-01-01 00:00:00 +0000
@@ -1,214 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    Daniel Reis
-#    2011
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import sys
-from datetime import datetime
-from osv import fields, osv
-import logging
-_logger = logging.getLogger(__name__)
-_loglvl = _logger.getEffectiveLevel()
-SEP     = '|'
-
-class import_odbc_dbtable(osv.osv):
-    _name="import.odbc.dbtable"
-    _description = 'Import Table Data'
-    _order = 'exec_order'
-    _columns = {
-        'name': fields.char('Datasource name', required=True, size=64),
-        'enabled': fields.boolean('Execution enabled'),
-        'dbsource_id': fields.many2one('base.external.dbsource', 'Database source', required=True),
-        'sql_source': fields.text('SQL', required=True, help='Column names must be valid "import_data" columns.'),
-        'model_target': fields.many2one('ir.model','Target object'),
-        'noupdate': fields.boolean('No updates', help="Only create new records; disable updates to existing records."),
-        'exec_order': fields.integer('Execution order', help="Defines the order to perform the import"),
-        'last_sync': fields.datetime('Last sync date', help="Datetime for the last succesfull sync. Later changes on the source may not be replicated on the destination"),
-        'start_run': fields.datetime('Time started', readonly=True),
-        'last_run': fields.datetime('Time ended', readonly=True),
-        'last_record_count': fields.integer('Last record count', readonly=True),
-        'last_error_count': fields.integer('Last error count', readonly=True),
-        'last_warn_count': fields.integer('Last warning count', readonly=True),
-        'last_log': fields.text('Last run log', readonly=True),
-        'ignore_rel_errors': fields.boolean('Ignore relationship errors', 
-            help = "On error try to reimport rows ignoring relationships."),
-        'raise_import_errors': fields.boolean('Raise import errors', 
-            help = "Import errors not handled, intended for debugging purposes."
-                 + "\nAlso forces debug messages to be written to the server log."),
-    }
-    _defaults = {
-        'enabled': True,
-        'exec_order': 10,
-    }
-
-    def _import_data(self, cr, uid, flds, data, model_obj, table_obj, log):
-        """Import data and returns error msg or empty string"""
-
-        def find_m2o(field_list): 
-            """"Find index of first column with a one2many field"""
-            for i, x in enumerate(field_list):
-                if len(x)>3 and x[-3:] == ':id' or x[-3:] == '/id':
-                    return i
-            return -1
-
-        def append_to_log(log, level, obj_id = '', msg = '', rel_id = ''):
-            if '_id_' in obj_id:
-                obj_id = '.'.join(obj_id.split('_')[:-2]) + ': ' + obj_id.split('_')[-1]
-            if ': .' in msg and not rel_id:
-                rel_id = msg[msg.find(': .')+3:]
-                if '_id_' in rel_id:
-                    rel_id = '.'.join(rel_id.split('_')[:-2]) + ': ' + rel_id.split('_')[-1]
-                    msg = msg[:msg.find(': .')]
-            log['last_log'].append('%s|%s\t|%s\t|%s' % (level.ljust(5), obj_id, rel_id, msg))
-        
-        
-        _logger.debug( data )
-        cols   = list(flds) #copy to avoid side effects
-        errmsg = str()
-        if table_obj.raise_import_errors:
-            model_obj.import_data(cr, uid, cols, [data], noupdate=table_obj.noupdate)
-        else:
-            try:
-                model_obj.import_data(cr, uid, cols, [data], noupdate=table_obj.noupdate)
-            except:
-                errmsg = str(sys.exc_info()[1])
-                
-        if errmsg and not table_obj.ignore_rel_errors:
-            #Fail
-            append_to_log(log, 'ERROR', data, errmsg )
-            log['last_error_count'] += 1
-            return False
-        if errmsg and table_obj.ignore_rel_errors:
-            #Warn and retry ignoring many2one fields...
-            append_to_log(log, 'WARN', data, errmsg )
-            log['last_warn_count'] += 1
-            #Try ignoring each many2one (tip: in the SQL sentence select more problematic FKs first)
-            i = find_m2o(cols)
-            if i >= 0:
-                #Try again without the [i] column
-                del cols[i]
-                del data[i]
-                self._import_data(cr, uid, cols, data, model_obj, table_obj, log)
-            else:
-                #Fail
-                append_to_log(log, 'ERROR', data, 'Removed all m2o keys and still fails.' )
-                log['last_error_count'] += 1
-                return False
-            
-        return True
-        
-
-    def import_run(self, cr, uid, ids=None, context=None):
-
-        db_model = self.pool.get('base.external.dbsource')
-        actions = self.read(cr, uid, ids, ['id', 'exec_order'])
-        actions.sort(key = lambda x:(x['exec_order'], x['id']))
-
-        #Consider each dbtable:
-        for action_ref in actions:
-            
-            obj = self.browse(cr, uid, action_ref['id'])
-            if not obj.enabled: continue #skip
-            
-            _logger.setLevel(obj.raise_import_errors and logging.DEBUG or _loglvl)
-            _logger.debug('Importing %s...' % obj.name)
-            
-            #now() microseconds are stripped to avoid problem with SQL smalldate
-            #TODO: convert UTC Now to local timezone (http://stackoverflow.com/questions/4770297/python-convert-utc-datetime-string-to-local-datetime)
-            model_name = obj.model_target.model
-            model_obj  = self.pool.get(model_name)
-            xml_prefix = model_name.replace('.', '_') + "_id_"
-            log = {'start_run': datetime.now().replace(microsecond=0),
-                   'last_run': None,
-                   'last_record_count': 0,
-                   'last_error_count': 0,
-                   'last_warn_count': 0,
-                   'last_log': list()}
-            self.write(cr, uid, [obj.id], log)
-
-            #Prepare SQL sentence; replace "%s" with the last_sync date
-            if obj.last_sync: sync = datetime.strptime(obj.last_sync, "%Y-%m-%d %H:%M:%S")
-            else:             sync = datetime.datetime(1900, 1, 1, 0, 0, 0)
-            params = {'sync': sync}
-            res    = db_model.execute(cr, uid, [obj.dbsource_id.id], obj.sql_source, params, metadata=True)
-                
-            #Exclude columns titled "None"; add (xml_)"id" column
-            cidx = [i for i, x in enumerate(res['cols']) if x.upper() != 'NONE']
-            cols = [x for i, x in enumerate(res['cols']) if x.upper() != 'NONE'] + ['id']
-
-            #Import each row:
-            for row in res['rows']:
-                #Build data row; import only columns present in the "cols" list
-                data = list()
-                for i in cidx:
-                    #TODO: Handle imported datetimes properly - convert from localtime to UTC!
-                    v = row[i]
-                    if isinstance(v, str): v = v.strip()
-                    data.append(v)
-                data.append( xml_prefix + str(row[0]).strip() )
-
-                #Import the row; on error, write line to the log
-                log['last_record_count'] += 1
-                self._import_data(cr, uid, cols, data, model_obj, obj, log)
-                if log['last_record_count'] % 500 == 0:
-                    _logger.info('...%s rows processed...' % (log['last_record_count']) )
-
-            #Finished importing all rows
-            #If no errors, write new sync date
-            if not (log['last_error_count'] or log['last_warn_count']):
-                log['last_sync'] = log['start_run']
-            level = logging.DEBUG
-            if log['last_warn_count']: level = logging.WARN
-            if log['last_error_count']: level = logging.ERROR
-            _logger.log(level, 'Imported %s , %d rows, %d errors, %d warnings.' % (
-                model_name,  log['last_record_count'],  log['last_error_count'] ,
-                log['last_warn_count'] ) )
-            #Write run log, either if the table import is active or inactive
-            if log['last_log']: 
-                log['last_log'].insert(0, 'LEVEL|== Line ==    |== Relationship ==|== Message ==')
-            log.update( {'last_log': '\n'.join(log['last_log'])} )
-            log.update({ 'last_run': datetime.now().replace(microsecond=0) }) #second=0, 
-            self.write(cr, uid, [obj.id], log)
-        #Finished
-        _logger.debug('Import job FINISHED.')
-        return True
-    
-
-    def import_schedule(self, cr, uid, ids, context=None):
-        cron_obj = self.pool.get('ir.cron')
-        new_create_id = cron_obj.create(cr, uid, {
-            'name': 'Import ODBC tables',
-            'interval_type': 'hours',
-            'interval_number': 1, 
-            'numbercall': -1,
-            'model': 'import.odbc.dbtable',
-            'function': 'import_run', 
-            'doall': False,
-            'active': True
-            })
-        return {
-            'name': 'Import ODBC tables',
-            'view_type': 'form',
-            'view_mode': 'form,tree',
-            'res_model': 'ir.cron',
-            'res_id': new_create_id,
-            'type': 'ir.actions.act_window',
-            }
-        
-import_odbc_dbtable()

=== removed file 'import_odbc/import_odbc_demo.xml'
--- import_odbc/import_odbc_demo.xml	2012-09-12 15:34:59 +0000
+++ import_odbc/import_odbc_demo.xml	1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0"?>
-<openerp>
-    <data>
-
-        <record model="import.odbc.dbtable" id="demo_postgresql_users">
-            <field name="name">Users from PostgreSQL </field>
-            <field name="dbsource_id" ref="base_external_dbsource.demo_postgre"/>
-            <field name="sql_source">select usename as "login", usename as "name" from pg_catalog.pg_user</field>
-            <field name="model_target" ref="base.model_res_users"/>
-        </record>
-
-    </data>
-</openerp>
-
-

=== removed file 'import_odbc/import_odbc_view.xml'
--- import_odbc/import_odbc_view.xml	2012-09-12 15:34:59 +0000
+++ import_odbc/import_odbc_view.xml	1970-01-01 00:00:00 +0000
@@ -1,86 +0,0 @@
-<?xml version="1.0"?>
-<openerp>
-    <data>
-
-        <!-- Table form -->
-
-        <record model="ir.ui.view" id="view_import_dbtable_form">
-            <field name="name">import.odbc.dbtable.form</field>
-            <field name="model">import.odbc.dbtable</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-	        <form>
-	            <field name="name" search="1"/>
-	            <field name="exec_order"/>
-	            <field name="model_target"/>
-	            <field name="dbsource_id" search="1"/>
-	            <field name="noupdate"/>
-	            <field name="enabled"/>
-	            <field name="ignore_rel_errors"/>
-	            <field name="raise_import_errors"/>
-                    <field name="last_sync"/>
-                    <group colspan="2">
-                        <button name="import_run" string="Run Import" type="object" icon="gtk-execute"/>
-                        <button name="import_schedule" string="Schedule Import" type="object" icon="gtk-paste"/>
-                    </group>
-	            <field name="sql_source" colspan="4"/>
-                    <separator string="Last execution" colspan="4"/>
-                    <field name="last_record_count"/>
-                    <field name="start_run"/>
-                    <field name="last_warn_count"/>
-	            <field name="last_run"/>
-                    <field name="last_error_count"/>
-                    <field name="last_log" colspan="4"/>
-                </form>
-            </field>
-        </record>
-
-        <!-- Table Tree -->
-
-        <record id="view_import_dbtable_tree" model="ir.ui.view">
-            <field name="name">import.odbc.dbtable.tree</field>
-	    <field name="model">import.odbc.dbtable</field>
-	    <field name="type">tree</field>
-	    <field name="arch" type="xml">
-                <tree colors="grey: enabled==False; red:last_error_count&gt;0; blue:last_warn_count&gt;0">
-			<field name="exec_order"/>
-			<field name="name"/>
-			<field name="model_target"/>
-			<field name="dbsource_id"/>
-			<field name="enabled"/>
-			<field name="last_run"/>
-			<field name="last_sync"/>
-			<field name="last_record_count"/>
-			<field name="last_error_count"/>
-			<field name="last_warn_count"/>
-		</tree>
-	</field>
-</record>
-
-
-<!-- Tree Search -->
-       <record id="view_import_dbtable_filter" model="ir.ui.view">
-            <field name="name">import.odbc.dbtable.filter</field>
-		<field name="model">import.odbc.dbtable</field>
-            <field name="type">search</field>
-            <field name="arch" type="xml">
-                <search string="Search ODBC Imports">
-				<field name="name"/>
-				<field name="dbsource_id"/>
-				<field name="model_target"/>
-               </search>
-            </field>
-        </record>
-
-<!--Menu-->
-    <record model="ir.actions.act_window" id="action_import_dbtable">
-      <field name="name">Import from SQL</field>
-      <field name="res_model">import.odbc.dbtable</field>
-      <field name="view_type">form</field>
-    </record>
-    <menuitem name="Import from SQL" id="menu_import_dbtable" parent="base.next_id_15" action="action_import_dbtable"/>
-</data>
-</openerp>
-
-
-

=== removed directory 'import_odbc/security'
=== removed file 'import_odbc/security/ir.model.access.csv'
--- import_odbc/security/ir.model.access.csv	2012-08-06 03:31:18 +0000
+++ import_odbc/security/ir.model.access.csv	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_import_odbc_dbsource_group_system,import_odbc_dbtable_group_system,model_import_odbc_dbtable,base.group_system,1,1,1,1

=== modified file 'report_synchronizer/__openerp__.py'
--- report_synchronizer/__openerp__.py	2012-12-26 09:58:46 +0000
+++ report_synchronizer/__openerp__.py	2013-09-02 20:41:47 +0000
@@ -23,7 +23,7 @@
 
 {
     'name': 'report_synchronizer',
-    'version': '6.1.0',
+    'version': '0.1',
     'category': 'Generic Modules/Others',
     'license': 'AGPL-3',
     'description': """Abstract module to send report to external system""",
@@ -34,7 +34,7 @@
     'update_xml': [
     ],
     'demo_xml': [],
-    'installable': False,
+    'installable': True,
     'active': False,
 }
 

=== modified file 'report_synchronizer/report_osv.py'
--- report_synchronizer/report_osv.py	2012-10-20 13:35:38 +0000
+++ report_synchronizer/report_osv.py	2013-09-02 20:41:47 +0000
@@ -25,14 +25,13 @@
 from tempfile import TemporaryFile
 
 @extend(Model)
-def send_report(self, cr, uid, external_session, ids, report_name, file_name, path, add_extension=True, context=None):
+def send_report(self, cr, uid, external_session, ids, report_name, file_name, path, context=None):
     service = netsvc.LocalService(report_name)
     result, format = service.create(cr, uid, ids, {'model': self._name}, context=context)
     output_file = TemporaryFile('w+b')
     output_file.write(result)
     output_file.seek(0)
-    if add_extension:
-        file_name = "%s.%s"%(file_name, format)
+    file_name = "%s.%s"%(file_name, format)
     external_session.connection.send(path, file_name, output_file)
     return file_name