[FIX] double defaults

This commit is contained in:
unknown
2013-09-24 10:25:24 +02:00
parent 6082f6a71d
commit 9b3943376f
3 changed files with 7 additions and 8 deletions

View File

@@ -26,9 +26,9 @@
'complexity': 'normal',
'depends': ['base', 'account'],
'description': """
This module allows you to import move/moveline via CSV asynchronously.
This module allows you to import moves / move lines via CSV asynchronously.
You can access model in the journal entries menu-> Move line importer.
You can access model in the journal entries menu -> Moves/ Move lines importer.
User must be an account manger.
To import a CSV simply save an UTF8 CSV file in the "file" field.

View File

@@ -35,7 +35,7 @@ _logger = logging.getLogger(__name__)
class move_line_importer(orm.Model):
"""Asynchrone move /move line importer.
"""Asynchrone move / move line importer.
It will parse the saved CSV file using orm.BaseModel.load
in a thread. If you set bypass_orm to True then the load function
will use a totally overriden create function that is a lot faster
@@ -96,16 +96,15 @@ class move_line_importer(orm.Model):
" and in conjonction with provided canvas."),
}
_defaults = {'delimiter': ',',
'bypass_orm': False}
def _get_current_company(self, cr, uid, context=None, model="move.line.importer"):
return self.pool.get('res.company')._company_default_get(cr, uid, model,
context=context)
_defaults = {'state': 'draft',
'name': fields.datetime.now(),
'company_id': _get_current_company}
'company_id': _get_current_company
'delimiter': ',',
'bypass_orm': False}
def _parse_csv(self, cr, uid, imp_id):
"""Parse stored CSV file in order to be usable by BaseModel.load method.

View File

@@ -5,7 +5,7 @@
<field name="name">move line importer form</field>
<field name="model">move.line.importer</field>
<field name="arch" type="xml">
<form version="7.0" string="Imported file">
<form version="7.0" string="Move / Move lines importer">
<header>
<button name="import_file"
type="object"