Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3441 Widoki

Hi,

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

CLIENT_TYPE = [
('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?

Thanks.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
9
cze 22
59585
4
gru 23
22316
5
lip 24
15675
1
cze 22
27198
9
maj 22
53452