Hello,
i need some help. I want to write a value after a module installation in odoo 15.
i tested it only with one id but later i wanted to iterate through all the partners.
I have the problem that the write function doesn't work.
I tried different ways but the value is never shown in the model.
class ResPartner(models.Model):
_inherit = 'res.partner'
customernumber_id = fields.Many2one('videc.customer.number')
customernumber = fields.Integer(string="Kundennummer",related='customernumber_id.customernumber')
vdb_customernumber = fields.Integer(string="Kundennummer",related='customernumber_id.vdb_customernumber')
def init(self):
record_to_update = self.env["res.partner"].browse(138)
vals = {'customernumber':11}
record_to_update["customernumber_id"].write(vals)