Skip to Content
Menu
This question has been flagged
1 Reply
3926 Views

I have 2 fields of the type Char and i want to join them to one field. I get an Internal Server Error. Can someone tell me what is wring ?

Code:

from odoo import api, fields, models


class Tarief(models.Model):
_name = 'insurance.tarief'

name = fields.Char(compute='_compute_name', store="True")
code = fields.Char(string="Code")
omschrijving = fields.Char(string="Omschrijving Verrichting")
soort_tarief = fields.Selection([
('particulier tarieven','Particulier Tarieven'),
('szf tarieven','SZF Tarieven'),
('bzsr','BZSR')
],string="Soort Tarief")
categorie = fields.Many2one("insurance.categorie", string="Categorie")
tarief = fields.Float(string="Tarief")

@api.depends('code','omschrijving')
def _compute_name(self):
for record in self:
record.name = record.code + record.omschrijving


Avatar
Discard

See Customization Tips: https://goo.gl/8HgnCF

Best Answer

Hi,

Try 

record.name = str(record.code)+str(record.omschrijving)
Avatar
Discard