Hi,
I try for my first custom module, to add '-customer' in the name if I change his name, juste for test if my @onchange call works correctly. ð
And... it doesn't work, nothing happens ! ð
The module is installed correctly. Here is my module structure :Â
SpeakerÂ
  > __init__.py
  > __openerp__.py
  > res_partner.py
__init__.py :Â
import res_partner
res_partner.py :Â
# -*- coding: utf-8 -*-
from openerp import models, fields, api, _
from openerp.exceptions import except_orm,Warning, ValidationError
from openerp.addons.base_openprod import utils
import logging
from openerp.osv import expression
_schema = logging.getLogger(__name__ + '.schema')
class res_partner(models.Model):
_name = 'res.partner'
_inherit = ['res.partner']
_order = 'reference, name'
@api.onchange('is_other_third_party')
def _onchange_nameotherparty(self):
if self.is_other_third_party:
self.name = self.name + "-otherparty"
return {
'warning': {
'title': "Change",
'message': "Name was changed",
}
}
Where did I screw up ? ðĪ
Thanks !Â