Thanks for you answer :)

Here my CSV file content : 

Title 1,
Title 2,
Title 3,
Name,
Firstname,
Title 4,
Addresses/Street,
Addresses/Street2,
Addresses/Zip,
Addresses/City,
Addresses/Country,
Addresses/Phone,
Addresses/Mobile,
Addresses/Fax,
Addresses/E-Mail,
Birth Date,
Native Language,
CAT,
Shift,
Categories/Categories,
Categories/Experience,
Combination/Type,
Combination/Combination,
Combination/Experience,
Combination/Price,
Combination/Price Currency,
Combination/By Unit,
Quality note,
Notes,
Banks/Name,
Banks/Code,
Banks/BIC/Swift code,
Banks/Street,
Banks/Street2,
Banks/Zip,
Banks/City,
Banks/Country,
Banks/Phone,
Banks/Fax,
Banks/E-Mail,
VAT number,
VAT rate


And here my columns definition : 

_name = 'type'
   _columns = {
      'name': fields.char('type',size=64, 
required=True),


_name = 'freelance'
   _columns = {
      'title1': fields.selection(_contact_title_get 
, 'Title 1', size=32),

      'name': 
fields.char('Name',size=64,required=True),

      'firstname': 
fields.char('Firstname',size=64),

      'title2': 
fields.selection([('Bc.','Bc.'),('Ing.','Ing.'),('Mgr.','Mgr.'),('PhDr.','PhDr.'),('PhD.','PhD.'),('JuDr.','JuDr.'),('RnDr.','RnDr.')],'Title
 2'),

      'title3': 
fields.selection([('Bc.','Bc.'),('Ing.','Ing.'),('Mgr.','Mgr.'),('PhDr.','PhDr.'),('PhD.','PhD.'),('JuDr.','JuDr.'),('RnDr.','RnDr.')],'Title
 3'),

      'title4': 
fields.selection([('Csc.','Csc.'),('mba','MBA')],'Title
 4'),

      'birth': fields.date('Birth Date'),

      'nativelang': 
fields.many2many('lang','freelance_lang_rel', 'freelance_id', 
'lang_id','Native Language'),

      'country': 
fields.many2one('res.country','Country'),

      'address': 
fields.one2many('res.partner.address','freelance_id','Addresses'),

      'evaluation': 
fields.selection([('0','0.Blacklisted'),('1','1.Supplier 
not recommended'),('2','2.Below average supplier'),('3','3. 
Average supplier'),('4','4.Good supplier'),('5','5.Favorite 
supplier')],'Quality note'),

      'evaluation_func': 
fields.function(_get_evaluation, method = True, type = 'integer' , store = 
False , string = 'Quality Mark', readonly=True),

      'cat': 
fields.selection([('none','None'),( 
'wordfast','Wordfast'),( 'other','Other')], 'CAT'),

      'comment': fields.text('Notes'),

      'events': 
fields.one2many('res.partner.event','freelance_id','Events'),

      'bank_ids': fields.one2many('res.bank', 
'freelance_id', 'Banks'),

      'vat_rate': fields.float('VAT rate'),

      'vat_number': fields.char('VAT number', 
size=64),

      'combination': 
fields.one2many('freelance.languagecombination', 'Combination/Price'),

      'categories': 
fields.one2many('freelance.categories', 'Categories'),

   }

_name = 'freelance.categories'
   _columns = {
      'name': 
fields.many2one('res.partner.categories', 'Categories'),

      'level_experience': 
fields.selection([('1','1. Occasional'),('2','2. 
Experienced'),('3','3. Professional'),('4','4. 
Specialist'),('5','5. Expert')],'Experience'),

      'level_experience_func': 
fields.function(_get_level_experience, method = True, type = 'integer' , 
store = False , string = 'Level Mark', readonly=True),

      'freelance_id': fields.many2one('freelance', 
'Freelance', readonly=True),

   }


_name = 'freelance.languagecombination'
   _columns = {
      'name': fields.char('Code',size=12),

      'level_experience': 
fields.selection([('1','1. Occasional'),('2','2. 
Experienced'),('3','3. Professional'),('4','4. 
Specialist'),('5','5. Expert')],'Experience'),

      'level_experience_func': 
fields.function(_get_level_experience, method = True, type = 'integer' , 
store = False , string = 'Level Mark', readonly=True),

      'freelance_id': fields.many2one('freelance', 
'Freelance', readonly=True),

      'source_language': 
fields.many2one('lang','Source Language'),

      'target_language': fields.many2one('lang', 
'Target Language'),

      'target_rate': fields.float('Target 
Rate'),

      'target_rate_unit': 
fields.selection([('word','Word'),('standard_page_cws','SP_Cw/S'),('standard_page_cwts','SP_Cw/oS'),('line','Line'),('page','Physical
 Page'),('day','Day'),('half-day','1/2 
Day'),('hour','Hour')],'By Unit'),

      'currency_target_rate': 
fields.many2one('res.currency','Target rate Currency'),

      'characters_source': fields.float('Characters 
Soure Language'),

      'type': fields.many2one('type','Type'),

      'price': fields.float('Price'),

      'unit_price': 
fields.selection([('word','Word'),('standard_page_cws','SP_Cw/S'),('standard_page_cwts','SP_Cw/oS'),('line','Line'),('page','Physical
 Page'),('day','Day'),('half-day','1/2 
Day'),('hour','Hour')],'By Unit'),

      'character_unit': fields.integer('Character 
unit'),

      'currency_price': 
fields.many2one('res.currency','Price Currency'),

   }

_name = "res.bank"
   _inherit = "res.bank"
   _description = "Bank freelance"
   _columns = {
      'freelance_id':fields.many2one('freelance', 
'Freelance'),
   }



 _inherit = 'res.partner.address'
    _columns = {
        'freelance_id': 
fields.many2one('freelance', 'Freelance', ondelete='set null', select=True, 
help="Keep empty for a private address, not related to freelance."),
    }



Thanks a lot for your help :)




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=60511#60511

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to