Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
7429 Weergaven

hi all,

nice to see you.

now, my problem ,if someone have any idea and can help me.

I try to add a field ,type of field : fields.funtion ( who concatenate two other field.char )

thanks

Avatar
Annuleer
Beste antwoord

This is the code

_function_example(self, cr, uid, ids, name, arg, context=None):
    res = {}
    records = self.browse(cr, uid, ids)
    for record in records:
        res[record.id] = '%s%s' % (record.field_char_1, record.field_char_2)
    return res

_columns = {
    'your_function_field' : fields.function(_function_example, type='char', size=64, method=True, store=False),
}
Avatar
Annuleer
Auteur

thanks a lot

Auteur

i have this error

I've update the code. Try now with the new code.

Auteur

thanks just i should add type="char"

Auteur Beste antwoord

i have this error :(

Uncaught Error: [_.sprintf] expecting number but found string

Just add : type="char"

Avatar
Annuleer
Beste antwoord
'your_function_field' : fields.function(_function_example, type='char', size=64, method=True, store=False),

Replace by:

'your_function_field' : fields.function(_function_example, string='your_string, type='char', size=64, method=True, store=False),
Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
nov. 20
6195
1
jun. 15
5055
1
mei 21
10628
1
jul. 16
7417
1
jul. 15
8573