Skip to content
Snippets Groups Projects
Commit c47bfdef authored by Juliana's avatar Juliana
Browse files

change compute to onchange function

parent 43848cb2
Branches 14.0
No related tags found
No related merge requests found
......@@ -11,16 +11,15 @@ class ScopQuestionnaireImport(models.Model):
year_riga = fields.Char("Année Riga")
type_id = fields.Many2one(compute="_compute_fields", store=True)
year = fields.Char(compute="_compute_fields", store=True)
effective_date = fields.Date(compute="_compute_fields", store=True)
type_id = fields.Many2one()
year = fields.Char()
effective_date = fields.Date()
# ------------------------------------------------------
# Fonctions compute
# Onchange Fields
# ------------------------------------------------------
@api.depends('year_riga')
@api.multi
def _compute_fields(self):
@api.onchange('year_riga')
def onchange_year_riga(self):
for questionnaire in self:
if questionnaire.year_riga != '14862' and questionnaire.year_riga != '14443':
year = questionnaire.env['riga.lookup.table'].search([
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment