Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2794 Vizualizări

Hello,


I want to do a simple test : trigger an onchange on res_partner model, and it never trigerred !

Module is installed, without errors.


Here is my code ( res_partner.py ) : 


from odoo import fields, models, api


class res_partner(models.Model):
_name = 'res.partner'
_inherit = ['res.partner']

@api.onchange('name')
def _onchange_name(self):

self.name = self.name + "xxx"

return {
'warning': {
'title': "name",
'message': "Name was changed",
}
}


__init__.py code from package models :

import res_partner

root __init__.py code :
from . import models


Here is my strucure :


test

    >__init__.py

    >__manifest__.py

    >static

    >models

        > __init__.py

        > res_partner.py

  


Thanks.


Imagine profil
Abandonează
Autor Cel mai bun răspuns

Resolved - I just forgot to restart odoo server after module upgrade...

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
apr. 22
2840
1
ian. 22
4651
1
iun. 25
1884
3
iul. 25
3488
1
mai 25
1616