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

can i use write() & create() to test if an model has new records or modified recods

Avatar
Discard
Best Answer

Hi MouBou,

Yes, you can use the functions of writing and creating, you leave an example to follow and you can see the data:

import logging
_logger = logging.getLogger(__name__)

class ew_example(models.Model):
    _name = 'ew.example

    api.model
    def create(self, vals):
        _logger.info('VALS>>>>>%r',vals)
        return super(ew_example, self).create(vals)

    @api.multi
    def write(self, vals):
        _logger.info('VALS>>>>>%r',vals)  
return super(ew_example, self).write(vals)

I hope it helps you, regards.

Avatar
Discard