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

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.


Avatar
Discard
Author Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
0
Apr 22
1818
1
Jan 22
3419
2
Dec 24
3139
1
Dec 24
362
4
Nov 24
1369