(self, record)
return any(differ(field.name) for field in self_sudo.trigger_field_ids)
Return whether any of the trigger fields has been modified on ``record``.
Return whether any of the trigger fields has been modified on ``record``.
Return whether any of the trigger fields has been modified on record .
def _check_trigger_fields(self, record):
        """ Return whether any of the trigger fields has been modified on ``record``. """
        self_sudo = self.sudo()
        if not self_sudo.trigger_field_ids:
            # all fields are implicit triggers
            return True

        if not self._context.get('old_values'):
            # this is a create: all fields are considered modified
            return True

        # Note: old_vals are in the format of read()
        old_vals = self._context['old_values'].get(record.id, {})

        def differ(name):
            field = record._fields[name]
            return (
                name in old_vals and
                field.convert_to_cache(record[name], record, validate=False) !=
                field.convert_to_cache(old_vals[name], record, validate=False)
            )
        return any(differ(field.name) for field in self_sudo.trigger_field_ids)
def _check_trigger_fields ( self , record ) : self_sudo = self . sudo ( ) if not self_sudo . trigger_field_ids : # all fields are implicit triggers return True if not self . _context . get ( 'old_values' ) : # this is a create: all fields are considered modified return True # Note: old_vals are in the format of read() old_vals = self . _context [ 'old_values' ] . get ( record . id , { } ) def differ ( name ) : field = record . _fields [ name ] return ( name in old_vals and field . convert_to_cache ( record [ name ] , record , validate = False ) != field . convert_to_cache ( old_vals [ name ] , record , validate = False ) ) return any ( differ ( field . name ) for field in self_sudo . trigger_field_ids )