Odoo Help


Can't pass value from res.partner to project.project

on 4/16/15, 2:24 AM 435 views


I'm trying to create a classification for customers (clients) in res.partner, and pass that value to the projects we do for them. For some reason the values just aren't coming through. This is the module code:

from openerp.osv import osv, fields

('a', 'Small'),
('b', 'Medium'),
('c', 'Large')

class client_client_type(osv.Model):
_inherit = 'res.partner'
_columns = {
'client_type' : fields.selection(CLIENT_TYPE, 'Client Type'),
_defaults = {
'client_type' : 'a',

class project_client_type(osv.Model):
_inherit = 'project.project'
_columns = {
'client_id' : fields.many2one('res.partner', string='Client'),
'proj_client_type' : fields.related('client_id', 'client_type', type='selection', selection=CLIENT_TYPE, readonly=True, store=True, string='Client Type'),

Can anybody see what I'm doing wrong?


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 4/16/15, 2:24 AM
Seen: 435 times
Last updated: 4/16/15, 2:24 AM