from openerp import models, fields, api, exceptions
import re
class ColombianTaxes(models.Model):
""" Model to create and manipulate personal taxes"""
_description= "Model to create own taxes"
_name = 'account.invoice'
_inherit = 'account.invoice'
# This is a colombian tax named Retenciòn en la fuente
resul= fields.Integer(string='resultado', default = 10 ,store=True, compute="_resul_pc")
@api.onchange('resul')
@api.depends('resul')
def _resul_pc(self):
self.resul = 100
the field on the view just dont take the value is still 0, i tried with and without @api.onchange @api.one, @api.depends('resul') without any @api it just dont change, and i dont have any error by odoo.
i tried
@api.one
@api.onchange('resul')
def _onchange_field(self):
if self.resul:
resultado ="10"
self.resul= resultado