csv2oerp Access Programming Interface v0.7.
An OpenERP connection interface.
Execute a query concordely to the Openerp method signature.
Parameters: |
|
---|
Get the description of list of fields.
Parameters: |
---|
Search for records based on a search domain.
Parameters: |
|
---|
Specify the column number (or custom value) and some special treatments from which the current model’s field will be allocated to the object’s creation.
Parameters: |
|
---|
Check field access fr openerp server
Parameters: |
|
---|
csv2oerp Access Programming Interface v0.6.
Set globals constants needed to initialize a connection to openerp
New in version 0.5.3.
Parameters: | |
---|---|
Raises : | nothing |
Main class which provides the functionnal part of the importation process.
Note
sys.argv integrated provides a command line parser.
Here are the available command line arguments:
-h, --help Show this kind of help message and exit
-o OFFSET, --offset=OFFSET Offset (Usually for header omission)
-l LIMIT, --limit=LIMIT Limit
-c, --check-mapping Check mapping template
-v, --verbose Verbose mode
-d, --debug
debug mode
-q, --quiet Doesn't print anything to stdout
Check mapping for semantics errors. http://www.openerp.com/forum/topic31343.html Also check for required and readonly fields.
Set constants needed to initialize a connection to OpenERP.
Parameters: |
---|
Object’s automatic and abstracted creation from model
Logged public method
Parameters: | |
---|---|
Returns: | int |
Retrieve lines which have value at column
By default value will be casted by column value type overwrite it by withcast=False
Parameters: |
|
---|---|
Returns: | int |
Retrieve lines which have value at column
Parameters: | line_num (value) – The index of line |
---|---|
Returns: | tuple |
Retrieve lines which have value at column
Parameters: |
|
---|---|
Returns: | tuple |
Set the CSV file to use.
Columns mapping configuration.
See Creation of your Columns mapping for further details.
Declare a parrallel script which will be called before importation.
It must implement a main method which take in params the instance of Import class, it will be able to use all facilities from Import class.
It must return a list of lines (lines already list too)
Specify a custom value for current field.
Mapping example:
>>> mapping = {
... 'model': {
... 'field': Custom('custom', search=True),
... }
... }
Parameters: |
---|
Specify a relation field. Also declares metadatas like required, readonly attributes.
Mapping example:
>>> {
... 'model': [
... {
... 'field': Relation('REL_custom::model', search=True),
... },
... ],
... 'REL_custom::model': {
... 'field': Column(1),
... }
... }
Parameters: |
|
---|
Specify a custom value for current field.
Mapping example:
>>> mapping = {
... 'model': {
... 'field': Custom('custom', search=True),
... }
... }
Parameters: |
---|
Exception used when a field is a relation and not relationnal in Oerp
Exception used when a column index has not be found
Exception used when a model is not conform
Exception used when a model is not conform
Exception used when a column index has not be found
Exception used when a subfunction need to skip a entire particular line
Usefull into lambda statement with field definition
Clean a string by removing returns and double quotes.
Strip accents, and replace carriages return by space, replace double quotes by simple ones
Encode a list in encode_from encoding
Strip accents, and replace carriages return by space, replace double quotes by simple ones
Parameters: | line – A list |
---|
Encode a list of list in encode_from encoding
Strip accents, and replace carriages return by space, replace double quotes by simple ones
Parameters: | lines – A list of list |
---|
Return a template’s skeleton code
prerequisites:
Having a columns header to the CSV file
Parameters: |
---|
Search for an equivalence between value from column col_referer and value value, and return value from column col_return index at the same line as matching pair col_referer values.
Parameters: |
|
---|---|
Returns: | list |
Search for an equivalence between value from column col_referer and value value, and return value from column col_return index at the same line as matching pair col_referer values.
Parameters: |
|
---|---|
Returns: | list |