From 3f5a39f82dcc4c8688366e7b268314ab5738c236 Mon Sep 17 00:00:00 2001 From: resteve Date: Fri, 18 Oct 2013 12:01:04 +0200 Subject: [PATCH] Change class order from csv_import file --- __init__.py | 2 +- csv_import.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/__init__.py b/__init__.py index 554fb71..36a9a61 100755 --- a/__init__.py +++ b/__init__.py @@ -8,7 +8,7 @@ from .csv_import import * def register(): Pool.register( CSVProfile, - BaseExternalMapping, CSVArchive, CSVImport, + BaseExternalMapping, module='csv_import', type_='model') diff --git a/csv_import.py b/csv_import.py index b188029..f62a5d5 100644 --- a/csv_import.py +++ b/csv_import.py @@ -16,7 +16,7 @@ import logging import os import psycopg2 -__all__ = ['CSVProfile', 'BaseExternalMapping', 'CSVArchive', 'CSVImport'] +__all__ = ['CSVProfile', 'CSVArchive', 'CSVImport', 'BaseExternalMapping'] __metaclass__ = PoolMeta @@ -71,15 +71,6 @@ class CSVProfile(ModelSQL, ModelView): return False -class BaseExternalMapping: - __name__ = 'base.external.mapping' - profile = fields.Many2One('csv.profile', 'CSV Profile') - parent = fields.Many2One('base.external.mapping', 'Parent Model') - rel_field = fields.Many2One('ir.model.field', 'Related Field') - required = fields.Boolean('Required', help='Avoid blank rows in csv file. ' - 'If not, the previous row is given.') - - class CSVArchive(Workflow, ModelSQL, ModelView): ' CSV Archive' __name__ = 'csv.archive' @@ -613,3 +604,12 @@ class CSVImport(ModelSQL, ModelView): Model = Pool().get('ir.model') models = Model.search([]) return [('', '')] + [(m.model, m.name) for m in models] + + +class BaseExternalMapping: + __name__ = 'base.external.mapping' + profile = fields.Many2One('csv.profile', 'CSV Profile') + parent = fields.Many2One('base.external.mapping', 'Parent Model') + rel_field = fields.Many2One('ir.model.field', 'Related Field') + required = fields.Boolean('Required', help='Avoid blank rows in csv file. ' + 'If not, the previous row is given.')